Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a strange problem with domain name resolution on my VPS. The problem is that when I do a ping, or telnet to a non-existing domain name, then the ".com" top level domain name gets automatically appended to the original domain name.

1) nslookup test

[root@myhost etc]# nslookup

** server can't find NXDOMAIN

OK - expected result

2) ping test

[root@myhost etc]# ping -v
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=238 time=78.2 ms
64 bytes from icmp_seq=2 ttl=238 time=74.5 ms
64 bytes from icmp_seq=3 ttl=238 time=76.4 ms
--- ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2427ms
rtt min/avg/max/mdev = 74.594/76.431/78.264/1.498 ms

NOK – non-existing domain gets resolved as “.com” somehow miraculously gets appended to the original domain. is a registered domain name so I can ping it, but I am pinging a different domain then I intended to.

3) telnet test

[root@myhost etc]# telnet 80
Connected to
Escape character is '^]'.

NOK – same as ping. This time however, telnet does not tell me I am actually connected to the host. I can only tell from the IP address.

This is my /etc/resolv.conf:


Thanks for any hints.

share|improve this question

migrated from Aug 12 '13 at 13:27

This question came from our site for professional and enthusiast programmers.

This is not a programming question. – James Polley Aug 12 '13 at 9:19

This is a feature, not a bug.

Say that your local domain is, and you have a machine called server. It's nice to be able to ping server and have everything Just Know(TM) that you meant

To accomplish this, there are a couple of settings that can be configured. These settings could be on your local machine (possibly set by your dhcp server, if you have one); or they could be on some upstream name server, so that when your system asks upstream "What's the address for server?" the answer it gets back is "silly, you mean, and btw it's".

The two things that control this lookup are a setting called "ndots"; if the hostname has "ndots" dots, it will not have this helpful extra lookup applied. Usually ndots is set to 1 - so that server would get extra help, but server.local wouldn't. In your case it sounds like ndots is set to at least 2 - it looks like is still having extra lookups done.

The other feature is the search list - a list of domains that get appended to the hostname to try to find a match. In the usual case, this would be "". In your case, it sounds as though "com" has ended up in the list - I'm guessing so that people can enter "yahoo" and have "" returned.

Again, this is probably being set by your DHCP server when it hands out a lease. If it was configured on your local machine it would probably be listed in /etc/resolv.conf.

share|improve this answer

Adding to James Polley's answer, you can usually override the search behavior by explicitly specifying that name resolution should begin at the DNS root zone. That is done by appending one . to the fully qualified host name.

So, instead of, you'd use The extra . instructs the resolver to try only this name and not use any configured search domains.

share|improve this answer
very good point! (no pun intended ;) – James Polley Aug 13 '13 at 12:58

You must log in to answer this question.