• adding a 3rd name server in centos

    From ian diddams@1:0/0 to All on Mon Oct 20 14:55:24 2014
    CentOS release 6.5 (Final)


    I need three nameservers to appear in /etc/resolv.conf

    in ifcfg-eth0 I have

    NS1=192.168.52.2
    NS2=192.168.52.4
    NS3=192.168.52.6

    but on reboot (or network restart) only the first two dns servers are shown.

    I've tried using PEERDNS=no with a hard coded resolv.conf - but that doesn;t work at all, resolv.conf still gets overwritten. (This is not a DHCP proviosioned IP, its static)


    any ideas?

    cheers

    Ian

    --- MBSE BBS v1.0.4 (GNU/Linux-i386)
    * Origin: The Kofo System II BBS telnet://fido2.kofobbs.
  • From HASM@110:300/11 to All on Mon Oct 20 15:55:31 2014
    ian diddams <iandiddamsorg@googlemail.com> writes:

    in ifcfg-eth0 I have
    ...
    I've tried using PEERDNS=no with a hard coded resolv.conf - but that
    doesn;t work at all, resolv.conf still gets overwritten. (This is not a
    DHCP proviosioned IP, its static)

    Are you running both NetworkManager and network by any chance.
    Editing ifcfg-ethX is a network type of activity. Maybe NM is interfering
    with your setup, as resolv.conf should not be overwritten. If you are
    using network, add NM_CONTROLLED=no to ifcfg-eth0.

    -- HASM

    --- MBSE BBS v1.0.4 (GNU/Linux-i386)
    * Origin: A noiseless patient Spider (110:300/11@linuxnet)
  • From ian diddams@1:0/0 to All on Mon Oct 20 16:07:08 2014
    well, I changed NM_CONTROLLED=yes to =no but it made no difference...


    Here's my ifcfg-eth0 (redacted for security yadda yadda)

    DEVICE=eth0
    HWADDR=00:50:56:9B:00:57
    TYPE=Ethernet
    UUID=c7b5398e-65e4-43db-a0c9-6889365ab99e
    ONBOOT=yes
    NM_CONTROLLED=no
    BOOTPROTO=none
    USERCTL=no
    IPV6INIT=no
    IPADDR=192.168.52.64
    NETMASK=255.255.255.0
    GATEWAY=192.168.52.1
    DNS1=192.168.52.2
    DNS2=192.168.52.4
    DNS3=192.129.53.10
    DOMAIN="xxx.co.uk win.xxx.co.uk internal.yyy.com yyy.com zzz.com"

    and here is the post reboot resolv.conf. It has been overwritten as before the reboot I put a dummy comment within it that has now disappeared.

    ; generated by /sbin/dhclient-script
    nameserver 192.168.52.2
    nameserver 192.168.52.4
    search xxx.co.uk win.xxx.co.uk internal.yyy.com yyy.com zzz.com



    didds

    --- MBSE BBS v1.0.4 (GNU/Linux-i386)
    * Origin: The Kofo System II BBS telnet://fido2.kofobbs.
  • From HASM@110:300/11 to All on Tue Oct 21 13:34:36 2014
    ian diddams <iandiddamsorg@googlemail.com> writes:

    Here's my ifcfg-eth0 (redacted for security yadda yadda)
    ONBOOT=yes
    NM_CONTROLLED=no
    BOOTPROTO=none

    and here is the post reboot resolv.conf.
    ; generated by /sbin/dhclient-script

    Something is not right, you have BOOTPROTO=none but dhclient was called on
    that interface.

    Are your sure your interface is called eth0 and not some other funky name? Look for it on the output of ifconfig.

    Or stop, disable and mask NM, make sure network is enabled, and reboot.
    systemctl stop NetworkManager
    systemctl disable NetworkManager
    systemctl mask NetworkManager
    systemctl enable network

    -- HASM

    --- MBSE BBS v1.0.4 (GNU/Linux-i386)
    * Origin: A noiseless patient Spider (110:300/11@linuxnet)
  • From Andre@110:300/11 to All on Wed Oct 22 10:04:47 2014
    Le 20/10/2014 16:55, ian diddams a ‚crit :
    CentOS release 6.5 (Final)


    I need three nameservers to appear in /etc/resolv.conf

    in ifcfg-eth0 I have

    NS1=192.168.52.2
    NS2=192.168.52.4
    NS3=192.168.52.6

    but on reboot (or network restart) only the first two dns servers are shown.

    I've tried using PEERDNS=no with a hard coded resolv.conf - but that doesn;t
    work at all, resolv.conf still gets overwritten. (This is not a DHCP proviosioned IP, its static)


    any ideas?

    cheers

    Ian

    check:
    /etc/sysconfig/networking/profiles/default/resolv.conf
    Andre

    - --- news://freenews.netfront.net/ - complaints: news@netfront.net ---

    --- MBSE BBS v1.0.4 (GNU/Linux-i386)
    * Origin: Netfront http://www.netfront.net/ (110:300/11@linuxnet)
  • From ian diddams@1:0/0 to All on Wed Oct 22 11:33:47 2014
    Thanks Andre - no difference in the two files...

    :-(


    I think the easiest solution will be to have a resolv.conf.real file and a startup script that just overwrites /etc/resolv.conf with its contents.

    cheers

    all

    --- MBSE BBS v1.0.4 (GNU/Linux-i386)
    * Origin: The Kofo System II BBS telnet://fido2.kofobbs.
  • From ian diddams@1:0/0 to All on Wed Oct 22 11:57:15 2014
    Hi HASM...

    systemctl isn't available on this system and not available via yum either ... I tried "service" instead as its CentOS, but service doesn't know anything about "NetworkManager"

    ian




    --- MBSE BBS v1.0.4 (GNU/Linux-i386)
    * Origin: The Kofo System II BBS telnet://fido2.kofobbs.
  • From HASM@110:300/11 to All on Wed Oct 22 12:57:31 2014
    ian diddams <iandiddamsorg@googlemail.com> writes:

    systemctl isn't available on this system and not available via yum either

    Lucky you. It will be on CentOS-7. I'm usually a Fedora user and lose
    track of which features migrate to the RHEL/CentOS releases.

    I tried "service" instead as its CentOS, but service doesn't know
    anything about "NetworkManager"

    Interesting. You said CentOS 6.5, which I don't have, but I do have access
    to a RHEL 6.1 system, and NetworkManager is available there:

    % cat /etc/redhat-release
    Red Hat Enterprise Linux Server release 6.1 (Santiago)
    % service NetworkManager status
    NetworkManager (pid 1432) is running...

    -- HASM



    --- MBSE BBS v1.0.4 (GNU/Linux-i386)
    * Origin: A noiseless patient Spider (110:300/11@linuxnet)
  • From ian diddams@1:0/0 to All on Wed Oct 22 14:15:29 2014
    FTR I've set the file (after correction to what I want) to be immutable

    chattr + i /etc/resolv.conf

    so it can't be overwritten.

    didds

    --- MBSE BBS v1.0.4 (GNU/Linux-i386)
    * Origin: The Kofo System II BBS telnet://fido2.kofobbs.
  • From HASM@110:300/11 to All on Thu Oct 23 01:17:01 2014
    ian diddams <iandiddamsorg@googlemail.com> writes:

    chattr + i /etc/resolv.conf

    You're asking for trouble somewhere down the line ...

    --- MBSE BBS v1.0.4 (GNU/Linux-i386)
    * Origin: A noiseless patient Spider (110:300/11@linuxnet)
  • From Andre@110:300/11 to All on Thu Oct 23 09:10:09 2014
    Le 20/10/2014 16:55, ian diddams a ‚crit :
    CentOS release 6.5 (Final)


    I need three nameservers to appear in /etc/resolv.conf

    in ifcfg-eth0 I have

    NS1=192.168.52.2
    NS2=192.168.52.4
    NS3=192.168.52.6

    but on reboot (or network restart) only the first two dns servers are shown.

    I've tried using PEERDNS=no with a hard coded resolv.conf - but that doesn;t
    work at all, resolv.conf still gets overwritten. (This is not a DHCP proviosioned IP, its static)


    any ideas?



    Ian

    I have no time to go deep in:
    /etc/sysconfig/network-scripts/ifup-post and ifup-aliases
    you could find there sources of your troubles.
    (no sure )
    Regards
    Andre


    - --- news://freenews.netfront.net/ - complaints: news@netfront.net ---

    --- MBSE BBS v1.0.4 (GNU/Linux-i386)
    * Origin: Netfront http://www.netfront.net/ (110:300/11@linuxnet)