Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 two systems, both running Ubuntu 12.04, which are within the same network (connected by hubs without routing logic). Both systems are configured quite similar, but not identical. In particular, the command route gives the identical results on both system.

Within the network a windows server is operating by a name winshared. One Linux system work resolving the IP:

> nslookup winshared

Name:   winshared.somepc.xx

while the other Linux system fails with

> nslookup winshared
;; connection timed out; no servers could be reached

Why do I see the difference in DNS resolution on both systems? And how to fix it?

Additional remarks:

  • The content of /etc/resolv.conf is identical on both systems with the content:

share|improve this question
Do you have multiple DNS nameservers? What do you see in /etc/resolv.conf – Jeight Nov 6 '13 at 16:12
Those files were different, I made them identical (on the second system I added a line like search winshared.de). But still the name could not be resolved. – Alex Nov 6 '13 at 16:18

The answer to this problem is starting from the entries in /etc/resolv.conf. The content is identical, and the given IP address refers to the system itself.

The next hint comes from the output of nslookup: It shows, the address of winshared is being resolved by a process listening on port 53. Using sudo netstat -nlp on the working system reveals one process dnsmasq listening on this port. The other system, however, has a second process, named, listening on this port. named is a DNS server and thus probably responsible for the mess of not able to resolve a name.

As explained this service can be stopped by uninstalling bind9, after which the DNS service is stopped on the faulty system, and both systems only have a process dnsmasq running on port 53, which is a leightweight forwarding service for DNS requests.

Afterwards, the name winshared can be resolved on both systems.

share|improve this answer

Typically servers behave differently because they're configured differently ;)

DNS servers are either set by DHCP or configured manually in the /etc/resolv.conf file.

Static entries for certain hostnames/ip-addresses may exist in /etc/hosts.

The /etc/nsswitch.conf may instruct the resolvers to give different precendence to sources such as local files / NIS / LDAP or DNS

share|improve this answer
And how can I fix my problem? As far as I know, both systems use static entries. The content of /etc/nsswitch.conf is also identical, only /etc/hosts differ in one additional line on the second system: PC-Test for unknown reasons. – Alex Nov 6 '13 at 16:24
The error message in your post is indicative that other server can't connect to the DNS servers which you have configured. Is /etc/resolv.conf really correct & correctly formatted? Can you ping those DNS servers? And lastly, nslookup always queries DNS and does not show /etc/hosts entries, while ping fi will be able to use entries from the hosts file. – HBruijn Nov 6 '13 at 16:39
As nslookup on the first system works, I assume /etc/resolv.conf is really correct and correctly formatted on the first system. The md5sums of the file /etc/resolv.conf are identical on both systems, so I can assume this file is also correct and correctly formatted on the second system. – Alex Nov 6 '13 at 16:53
Then it's time for the default excuse for a sysadmin, blame the network! Can you ping the ip-address of your nameserver(s) from both servers? – HBruijn Nov 6 '13 at 16:57
Yes, the IP address is fine in both cases. – Alex Nov 6 '13 at 17:02

I suppose the file /etc/resolv.conf is generated by the packet resolvconf.

Are you using static or Dynamic network configuration?

Have a look at the differents files in /etc/resolvconf/ and /etc/networks/interfaces.

Or if installed, use network-manager.

share|improve this answer

Your Answer


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.