PDA

View Full Version : [ubuntu] DNS resolver problem in Ubunutu 12.04 server



atakacs
August 16th, 2012, 08:36 PM
My first Precise Pangolin deployment.

I'm having issues with dns resolution not working - turns out /etc/resolv.conf is not anymore the place to manage this.

I tried to add “dns-nameservers”, “dns-search” and “dns-domain” entries in /etc/network/interfaces but they don't seem to work either (no server could be reached error, although I can ping those listed with dns-nameservers).

My interfaces files reads


auto eth0
iface eth0 inet static
address 172.16.200.50
netmask 255.255.255.0
gateway 172.16.200.1
dns-nameservers 172.16.200.25 172.16.100.5
dns-search mydomain.localIf I do a host xxx.domain.com 172.16.200.25 it resolves fine - it's just that there is a config problem with default resolvers. Issuing a "dig" times out with "no server could be reached".

I tried to manually edit /etc/resolvconf/resolv.conf.d/head but it doesn't help.

What am I missing ?

CharlesA
August 16th, 2012, 08:59 PM
Disable DNSMasq and see what happens.

http://ubuntuforums.org/showpost.php?p=11923702&postcount=40

atakacs
August 16th, 2012, 09:09 PM
Disable DNSMasq and see what happens.

http://ubuntuforums.org/showpost.php?p=11923702&postcount=40

no network manager present on said machine (hence no NetworkManager forler to edit config in)

CharlesA
August 16th, 2012, 09:26 PM
Are you using the correct subnet?

Using /24 would mean it would need to go thru the gateway to hit .100.5.

Have you tried adding a public DNS server such as 8.8.8.8 and seeing if it does the same thing?

atakacs
August 16th, 2012, 09:28 PM
Are you using the correct subnet?

Using /24 would mean it would need to go thru the gateway to hit .100.5.

Thast's the case and it works fine if I specify the 100.5 dns in a host lookup.


Have you tried adding a public DNS server such as 8.8.8.8 and seeing if it does the same thing?

Yep - no joy.

CharlesA
August 16th, 2012, 10:15 PM
Post your /etc/resolv.conf file please.

atakacs
August 16th, 2012, 10:22 PM
Post your /etc/resolv.conf file please.

You are aware that there no such file in Unbuntu 12 ? it's a symlink to ../run/resolvconf/resolv.conf

It reads

# DO NOT EDIT THIS FILE BY HAND
search mydomain.com

CharlesA
August 16th, 2012, 10:24 PM
You are aware that there no such file in Unbuntu 12 ? it's a symlink to ../run/resolvconf/resolv.conf

It reads

# DO NOT EDIT THIS FILE BY HAND
search mydomain.com
Doesn't matter.

Mine says this:


charles@Thor:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1


Have you restarted networking? resolvconf should modify that file when the machine is booted or networking is restarted.


iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.1.1

atakacs
August 16th, 2012, 10:38 PM
Have you restarted networking? resolvconf should modify that file when the machine is booted or networking is restarted.

Of course - restarted too.

I managed to have something working by creating /etc/resolvconf/resolv.conf.d/tail file and manually inserting "nameserver 8.8.8.8". This is being carried over into the "dynamically assembled" resolv.conf and allows for successful dns resolution. Obviously not the intended behavior but at least I can get things moving now...