Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: resolv.conf keeps old configurations

  1. #1
    Join Date
    Mar 2012
    Beans
    8

    resolv.conf keeps old configurations

    I have been searching for this answer for awhile and came up with nothing. I recently upgraded from ubuntu 10.04 to 12.04 and I understand the auto config of the resolv.conf file and I have edited the /network/interface to include the changes but it keeps old configurations from when it was 10.04.

    EXAMPLE:
    network/interface=

    auto eth0
    iface eth0 inet static
    address <IP_ADDRESS>
    netmask 255.255.255.0
    gateway <IP_ADDRESS>
    network <IP_ADDRESS>
    broadcast <IP_ADDRESS>

    dns-search <NEW_DOMAIN>
    dns-domain <NEW_DOMAIN>
    dns-nameservers <NEW_IP_ADDRESS> 4.2.2.1 8.8.8.8

    I look into the /resolv.conf and it shows this:

    nameserver <NEW_IP_ADDRESS>
    nameserver 4.2.2.1
    nameserver 8.8.8.8
    search <NEW_DOMAIN>
    domain <OLD_DOMAIN>
    search <OLD_DOMAIN>
    nameserver <OLD_IP_ADDRESS>
    nameserver 4.2.2.1
    nameserver 4.2.2.2

    Any suggestions would be great

  2. #2
    Join Date
    Mar 2011
    Location
    Germany
    Beans
    315
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: resolv.conf keeps old configurations

    Hello, pamiller3.

    Automatically updating resolv.conf will work on Ubuntu 12.04 only in case resolv.conf itself is located in the folder /run/resolvconf. The folder /etc has got to hold a symbolic link to /run/resolvconf/resolv.conf.
    Code:
    karl@ubuntu12 /etc $ ls -l resolv.conf
    lrwxrwxrwx 1 root root 27 Aug  5 13:43 resolv.conf -> /run/resolvconf/resolv.conf
    karl@ubuntu12 /etc $
    Kind regards,
    Karl
    Enlightened by Lucid Lynx, enchanted by Maya Mint, trusting the Tahr.

  3. #3
    Join Date
    Mar 2012
    Beans
    8

    Re: resolv.conf keeps old configurations

    Alright I made the changes and removed the old configurations out of the /run/resolvconf/resolv.conf and then did an interface restart and it still shows the old configurations

  4. #4
    Join Date
    Apr 2012
    Beans
    5,479

    Re: resolv.conf keeps old configurations

    Hi I *think* that when you do a dist-upgrade from a release that pre-dates the resolvconf service, your old manual DNS config gets saved to one of the files in /etc/resolvconf/resolv.conf.d/ (either /etc/resolvconf/resolv.conf.d/original or /base - not sure) and then appended to the dynamically generated /etc/resolv.conf file - maybe look in there and see if you can find the old entries?

    See here:- http://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/

  5. #5
    Join Date
    Mar 2012
    Beans
    8

    Re: resolv.conf keeps old configurations

    That seems to have worked, I eliminated the contents of the /etc/resolvconf/resolv.conf.d/original file and it worked. Thanks for that.

    A follow up is I am trying to add the line dns-domain in the network/interface file and when I do that it does not add that to the resolv.conf file. Is there anyway that I can make sure that this server is added to the domain?

  6. #6
    Join Date
    Apr 2012
    Beans
    5,479

    Re: resolv.conf keeps old configurations

    sorry I'm not familiar with a dns-domain field - I've only seen dns-nameservers and dns-search

  7. #7
    Join Date
    Mar 2012
    Beans
    8

    Re: resolv.conf keeps old configurations

    Alright I maybe barking up the wrong tree, I found that command on a blog...or forum..or somewhere around the inet.

    Is there an easy command to confirm the hostname is part of the domain. For example: hostname.domain.com

    Thanks so much for the help

  8. #8
    Join Date
    Apr 2012
    Beans
    5,479

    Re: resolv.conf keeps old configurations

    not sure exactly what you are looking for - in a general context you can get the host's fqdn using

    Code:
    hostname -f
    but that's not exactly related to your /etc/network/interfaces DNS settings

  9. #9
    Join Date
    Mar 2005
    Beans
    211

    Re: resolv.conf keeps old configurations

    Quote Originally Posted by pamiller3 View Post
    That seems to have worked, I eliminated the contents of the /etc/resolvconf/resolv.conf.d/original file and it worked. Thanks for that.

    A follow up is I am trying to add the line dns-domain in the network/interface file and when I do that it does not add that to the resolv.conf file. Is there anyway that I can make sure that this server is added to the domain?
    The more correct thing to do would have been to eliminate the symlink /etc/resolvconf/resolv.conf.d/tail -> original and replace it by /etc/resolvconf/resolv.conf.d/tail -> /dev/null. But emptying /etc/resolvconf/resolv.conf.d/original works just as well.

  10. #10
    Join Date
    Mar 2005
    Beans
    211

    Re: resolv.conf keeps old configurations

    Quote Originally Posted by pamiller3 View Post
    A follow up is I am trying to add the line dns-domain in the network/interface file and when I do that it does not add that to the resolv.conf file. Is there anyway that I can make sure that this server is added to the domain?
    Resolvconf only ever adds a "search" line to resolv.conf, never a "domain" line. This is because "search" lines do everything "domain" lines do, but are more versatile. The glibc resolvconf only uses either "domain" or "search", not both. So "search" it is.

    In /etc/network/interfaces the use of "dns-domain" options works (and is treated as synonymous with "dns-search") but is deprecated in favor of "dns-search" for the reason just given.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •