Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer
    
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 '11 at 11:33

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

share|improve this answer
    
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 '11 at 11:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.