I am getting an "unmatched host" error after configuring an NFS share using a hostname. Whitelisting using IP address works fine.
On a server called "server1", I have this line in the /etc/exports listing both values server2 and it's FQDN, server2.tailcb999.ts.net:
/volume1/my-files server2(rw,async,no_wdelay,no_root_squash,insecure_locks,sec=sys,anonuid=1025,anongid=100) server2.tailcb213.ts.net(rw,async,no_wdelay,no_root_squash,insecure_locks,sec=sys,anonuid=1025,anongid=100)
On a server called "server2", I run this command:
mount -t nfs server1:/volume1/my-files /tmp/mount-sample/
After running the above command, I get this error:
mount.nfs: access denied by server while mounting server1:/volume1/my-files
After checking server logs, I see this:
2024-05-28T00:59:48+03:00 server1 mountd[10698]: refused mount request from 101.127.119.103 for /volume1/my-files (/volume1/my-files): unmatched host
101.127.119.103 is the IP address of "server2".
How come NFS refuses to accept connections from a host that is clearly allowed?
P.S. in an attempt to understand more about this problem, I ran nslookup:
$ nslookup server2
Server: 100.100.100.100
Address: 100.100.100.100#53
Name: server2.tailcb999.ts.net
Address: 101.127.119.103
$
$ nslookup server2.tailcb999.ts.net
Server: 100.100.100.100
Address: 100.100.100.100#53
Name: server2.tailcb999.ts.net
Address: 101.127.119.103
$
$ nslookup 101.127.119.103
Server: 100.100.100.100
Address: 100.100.100.100#53
101.127.119.103.in-addr.arpa name = server2.tailcb999.ts.net.
$
I am using Tailscale to connect server1 and server2. server1 is a Synology DS218+ box, while server2 is a regular linux box. Whitelisting another box, let's call it server3 that is in the same LAN like this works too (note the .lan zone):
/volume1/my-files server3.lan(rw,async,no_wdelay,no_root_squash,insecure_locks,sec=sys,anonuid=1025,anongid=100)