resolv.conf is changed when linode is rebooted

I'm running Slackware 10. I run netconfig to set the ip a static address and dns server, and confirm that etc/resolv.conf is updated. When I reboot the linode my resolv.conf has all the name servers removed and only one line for the search domain. Any ideas?

7 Replies

Linode changes resolv.conf on boot, to set default nameservers. If you modify resolv.conf I have no idea what you will get when booting.

@gmt:

Linode changes resolv.conf on boot, to set default nameservers. If you modify resolv.conf I have no idea what you will get when booting.
We do? That's news to me. :)

It's usually dhcpd that's the culprit, or some other init script.

-Chris

The date on /etc/resolv.conf changes every time I reboot, and I certainly didn't configure it.

On my Linode (running Gentoo), /etc/init.d/domainname has a tinker with /etc/resolv.conf at every boot. My emergency Debian doesn't look as if any changes are made during boot.

edit Missed the part about you using static config…

What's your /etc/rc.d/rc.inet1.conf look like?

If you have a line like USE_DHCP[0]="yes" in there, it will still kick in the dhcp client…

------------------ original text follows --------------------

I'm betting it's dhcpcd doing that.

Run it with the -R option.

Read the manpage for dhcpcd.

Fix:

Look for "/sbin/dhcpcd" in /etc/rc.d/rc.inet1

Add the -R switch to the command invocation on interface start (probabaly around line 74)

          echo "/etc/rc.d/rc.inet1:  /sbin/dhcpcd -d -t 10 -h ${DHCP_HOSTNAME[$1
]} eth${1}" | $LOGGER
          /sbin/dhcpcd -d -t 10 -h ${DHCP_HOSTNAME[$1]} eth${1}
        else
          echo "/etc/rc.d/rc.inet1:  /sbin/dhcpcd -d -t 10 eth${1}" | $LOGGER
          /sbin/dhcpcd -d -t 10 eth${1}
        fi

becomes

          echo "/etc/rc.d/rc.inet1:  /sbin/dhcpcd -d -R -t 10 -h ${DHCP_HOSTNAME[$1
]} eth${1}" | $LOGGER
          /sbin/dhcpcd -d -R -t 10 -h ${DHCP_HOSTNAME[$1]} eth${1}
        else
          echo "/etc/rc.d/rc.inet1:  /sbin/dhcpcd -d -R -t 10 eth${1}" | $LOGGER
          /sbin/dhcpcd -d -t 10 eth${1}
        fi

What's your /etc/rc.d/rc.inet1.conf look like?

If you have a line like Code:

USE_DHCP[0]="yes"

in there, it will still kick in the dhcp client…

It was USE_DHCP[0]=""

I changed it to USE_DHCP[0]="No" and it fixed it.

Also be aware that if a package named "resolvconf" is installed, it will eat your /etc/resolv.conf on boot (do an ls -l /etc/resolv.conf and make sure it's NOT a symlink)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct