3

The Issue

On my company's internal network, there is a development server called devserver.mycompany.com

Usually I can connect to this server with out issue, but sometimes (seems random to me) Ubuntu won't be able to resolve the address.

Other Information and Observations

When I run nmcli dev list iface eth0 in a terminal, I see that there are two configured DNS Servers:

IP4.DNS[1]:                             192.168.50.103
IP4.DNS[2]:                             128.255.1.3

The second dns server is my ISP's server.

I never have this issue on my Windows partition which is configured to use the same two DNS Servers.

When I am experiencing the issue:

  • nslookup devserver.mycompany.com fails
  • nslookup devserver.mycompany.com 128.255.1.3 fails all the time (no surprise, devserver is not a public server)
  • nslookup devserver.mycompany.com 192.168.50.103 works

Here's the actual output of nslookup:

Ubuntu-14:~$ nslookup devserver.mycompany.com
Server:     127.0.1.1
Address:    127.0.1.1#53

** server can't find devserver.mycompany.com: NXDOMAIN

Questions

  • From the above output, it looks like Ubuntu is trying to use a local DNS server. Correct? Is it caching a failed lookup on my local machine?
    • If it is caching, how can I clear the cache?
  • Is Ubuntu using this second DNS server sometimes? Why? Is it load balancing? Is the local one slower?
  • How should I fix this? I don't want to remove the second DNS server in case the primary one goes down.
  • And finally, why don't I experience this issue in Windows?

Ubuntu Version Information

ubuntu 14.04 LTS with no outstanding updates.

All the networking was setup more or less automatically. Using DHCP

  • It kind of feels like dnsmasq tells nslookup to use the 128 server, for some reason, even though nmcli dev list reports 192-one as primary – Sergiy Kolodyazhnyy Jun 9 '15 at 15:48
1

From the above output, it looks like Ubuntu is trying to use a local DNS server. Correct? Is it caching a failed lookup on my local machine?

Yes, Ubuntu is using whatever was provided with dhcp lease, more specifically dnsmasq, a plug-in, that takes care of that for network-manager.

Is Ubuntu using this second DNS server sometimes? Why? Is it load balancing? Is the local one slower?

If the first dns fails to resolve, then dnsmasq should redirect the query to the secondary dns. At least that's the idea.

In case you'd like to use your own dns-server Personally, I always use supersede domain-name-server xxx.xx.xxx.xxx in /etc/dhcp/dhclient.conf to tell my Ubuntu system to replace whatever dns it receives via dhcp lease with my own server. Here's the excerpt from that file:

30)serg@ubuntu[/home/xieerqi]
>_ cat /etc/dhcp/dhclient.conf                                                 
# Configuration file for /sbin/dhclient, which is included in Debian's
#   dhcp3-client package.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
#   man page for more information about the syntax of this file
#   and a more comprehensive list of the parameters understood by
#   dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
#   not leave anything out (like the domain name, for example), then
#   few changes must be made to this file, if any.
#

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

#send host-name "andare.fugue.com";
send host-name = gethostname();
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
supersede domain-name-servers 208.67.220.220;
#prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    dhcp6.name-servers, dhcp6.domain-search,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers,
    dhcp6.fqdn, dhcp6.sntp-servers;

After setting that up and reconnecting or restarting network-manager, here's what I have:

31)serg@ubuntu[/home/xieerqi]
>_ nmcli dev list | grep -i dns                                                
IP4.DNS[1]:                             208.67.220.220

Nslookup will report Server: 127.0.1.1 and Address: 127.0.1.1#53 since it is Network-Manager's dsnmasq that listens on that address, and it uses whatever was provided by dhcp ( in this case , the substituted dns)

  • If I setup supersede domain-name-server like your configuration uses, won't I be unable to connect to anything when I'm not on my company's LAN? – Jon Jun 12 '15 at 20:29
  • @Jonathan727 For company's LAN: If you use something like 8.8.8.8 ( google's public dns ) and want to access you company's non public domains, that probably won't work. If you use your company's DNS, it seems a little redundant to do so, since dhcp already provides you with those addresses, so it's like replacing butter with butter - same thing. Better option in your case is probably prepend domain-name-server . It gets whatever dhcp sends and adds its own dns to the list. So you can prepend 8.8.8.8 and use it outside of the company – Sergiy Kolodyazhnyy Jun 12 '15 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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