Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
Server:     127.0.0.1
Address:    127.0.0.1#53

Name:   winshared.somepc.xx
Address: 172.16.0.110

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:

    nameserver 127.0.0.1
    
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
add comment

3 Answers

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
add comment

The answer to this problem is starting from the entries in /etc/resolv.conf. The content is identical, and the given IP address 127.0.0.1 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
add comment

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: 127.0.1.1 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
show 1 more comment

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.