2

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?

2 Answers 2

1

Check out your /etc/resolv.conf. I am guessing there is a line in that which says something like domain ispname.net. So that is saying that your host is part of that domain. When you look up your localname, that domain is getting appended.

Try using dig localname, and you should see a result like the following:

;; ANSWER SECTION:
localname.      0   IN  A   192.168.1.135

Dig gives a lot of information and is really useful in debugging name resolution questions.

1
  • The domain suffix is irrelevant here. Here, a reverse lookup, mapping (client side) IP address to domain name (to be checked against hosts.allow), is being performed.
    – JdeBP
    Jun 14, 2011 at 11:33
0

Also check the /etc/resolv.conf for something like search ispname.net. You can have multiple entries that can be added to the hostname.

1
  • The search path is irrelevant here. Here, a reverse lookup, mapping (client side) IP address to domain name (to be checked against hosts.allow), is being performed.
    – JdeBP
    Jun 14, 2011 at 11:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .