2

I had been using Ubuntu 10.04.3 or 11.04. In either of these versions, hostnames like ec2-123-45-6-7.compute-1.amazonaws.com would resolve to a private in the 10.0.0.0/8 range. After upgrading to 12.04, they now resolve to public addresses.. e.g. 184.1.2.3. It seems it's because Ubuntu now uses resolvconf. It also appears that I'm running named.

# more /run/resolvconf/interface/eth0.dhclient
domain ec2.internal
nameserver 172.16.0.23
# more /run/resolvconf/interface/lo.named
nameserver 127.0.0.1

/etc/resolv.conf is a symlink to /run/resolvconf/resolv.conf

 more /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 127.0.0.1
 search ec2.internal

If I edit resolv.conf to point to 172.16.0.23 instead of 127.0.0.1 it works correctly, but after reboot it changes back.

Additionally, here is the contents of /etc/resolvconf/resolv.conf.d

/etc/resolvconf/resolv.conf.d# more base
nameserver 172.16.0.23
domain ec2.internal
search ec2.internal

/etc/resolvconf/resolv.conf.d# more head
# 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

/etc/resolvconf/resolv.conf.d# more original
nameserver 172.16.0.23
domain ec2.internal
search ec2.internal

# more interface-order
# interface-order(5)
lo.inet*
lo.dnsmasq
lo.pdnsd
lo.!(pdns|pdns-recursor)
lo
tun*
tap*
hso*
em+([0-9])?(_+([0-9]))*
p+([0-9])p+([0-9])?(_+([0-9]))*
eth*
ath*
wlan*
ppp*
*

The config files seem to be setup correctly, but it keeps going back to 127.0.0.1. I guess it wants to point to 127.0.0.1 so it can use the local named service, which seems like a really odd thing for Ubuntu to install and use by default.

What am I doing wrong? Is there a 'preferred' way of doing this, instead of messing with resolvconf should I get the local named service to resolve correctly?

0

1 Answer 1

1
  • Make /etc/resolvconf/resolv.conf.d/base empty. The information in it is provided dynamically by dhclient to resolvconf.

  • If you don't need to be running named locally, uninstall the bind9 package.

  • If you need to run named locally and you don't want to use it to resolve names locally, set RESOLVCONF=no in /etc/default/bind9 and then reboot. Setting RESOLVCONF=no causes bind9 not to register address 127.0.0.1 with resolvconf when named starts.

Ref: https://bugs.launchpad.net/ubuntu/+source/bind9/+bug/933723

1
  • Thanks for the link. I'm glad they removed installing named by default.
    – skrewler
    Oct 21, 2014 at 12:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .