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. 220.127.116.11. 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?