This might be a stupid easy question for some of you, but I couldn't find a fast, accurate answer online.
I had a problem recently where I was trying to SSH to a local FreeBSD server, but the connection was refused. The hosts.allow file on the machine specified that only local machines should be allowed to communicate with the ssh daemon (which essentially means the hostname of the client cannot contain a dot, according to the hosts_access man page). I figured out (at least I think I did) that the cause of this problem was that the server was trying to resolve the hostname of the client, but the request was forwarded to my ISP's DNS servers. Hence, the hostname of the client would resolve to localname.ispname.net instead of just localname, which means it did not pass the hosts.allow access rule.
Additionally, when I pinged the IP address of the client from the server (or vise versa), the ping utility displayed a FQDN in the form of localname.ispname.net, just like with sshd. Once I enabled the "local DNS" option on my router and cleared the DNS cache on the router, everything worked fine, presumably because the hostnames were resolved locally.
My question is, how did my ISP's DNS servers know the hostname of my local machine when they resolved the IP address of the machine to a FQDN? It seems like this would involve a reverse DNS request to my default gateway... is this correct?