Results 1 to 8 of 8

Thread: change resolv.conf

  1. #1

    Default change resolv.conf

    Hi,

    i just tried file resolv.conf only add nameserver, but i added nameserver and save file resolv.conf and reboot pc. The resolv.conf file remained unchanged after the reboot. The added nameserver was gone.

    Please help me how to manually change resolv.conf file.

    The only way I came was through yast2 in the network settings. I wrote them here and saved the change. But here you can add only 3 nameservers and I need 4. So I need to add one more.


    Thanks for help

  2. #2
    Join Date
    Sep 2012
    Posts
    4,972

    Default Re: change resolv.conf

    Quote Originally Posted by czczc View Post
    But here you can add only 3 nameservers and I need 4.
    According to current documentation, resolver does not use more than 3 nameservers.

  3. #3

    Default Re: change resolv.conf

    Quote Originally Posted by arvidjaar View Post
    According to current documentation, resolver does not use more than 3 nameservers.

    Thx for clarification.

    Back to problem:

    However, how to change the resolv.conf file manually without having to use yast2 to make the change take effect.

    Thx

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,853

    Default Re: change resolv.conf

    When you edit the file with an editor, I assume you can not avoid seeing:
    Code:
    ### Please remove (at least) this line when you modify the file!
    Dif you abide to that?

    And, of course you should not let DHCP configure that file.

    BTW, using YaST for it is only useful (maybe even only possible) when you use Wicked and not NM.
    Henk van Velden

  5. #5
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,352
    Blog Entries
    3

    Default Re: change resolv.conf

    Quote Originally Posted by czczc View Post
    However, how to change the resolv.conf file manually without having to use yast2 to make the change take effect.
    As far as I know, you will need to use Yast.
    Code:
    # ls -l /etc/resolv.conf
    lrwxrwxrwx 1 root root 30 May 11 20:06 /etc/resolv.conf -> /var/run/netconfig/resolv.conf
    # ls -l /var/run
    lrwxrwxrwx 1 root root 4 May 11 19:50 /var/run -> /run
    So "resolv.conf" is really in "/var/run/netconfig". And "/var/run" is really "/run" which uses "tmpfs". So any changes that you make to "resolv.conf" will go away on reboot.

    By the way, this is a change from Leap 15.0, where "resolv.conf" was still an actual file in "/etc".
    openSUSE Leap 15.1; KDE Plasma 5;

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,853

    Default Re: change resolv.conf

    I assume that you can still undo the link and have a real/fix /etc/resolv.conf But that should be tested first.
    Henk van Velden

  7. #7
    Join Date
    Mar 2011
    Location
    Sauerland
    Posts
    3,882

    Default AW: change resolv.conf

    Here after an Update from Leap 15.0 to 15.1 it works with the old /etc/resolv.conf, but no dhcp.

    Code:
    stephan@hp-laptop:~> ls -la /etc/resolv.conf
    -rw-r--r-- 1 root root 820 20. Apr 00:52 /etc/resolv.conf

  8. #8
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,921
    Blog Entries
    2

    Default Re: change resolv.conf

    Is there some reason why no one seems to be reading /etc/resolv.conf and actually following its instructions?
    This has always worked for me...

    Code:
    # Before you change this file manually, consider to define the# static DNS configuration using the following variables in the
    # /etc/sysconfig/network/config file:
    #     NETCONFIG_DNS_STATIC_SEARCHLIST
    #     NETCONFIG_DNS_STATIC_SERVERS
    #     NETCONFIG_DNS_FORWARDER
    # or disable DNS configuration updates via netconfig by setting:
    #     NETCONFIG_DNS_POLICY=''
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Posting Permissions

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