New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolv.conf is emptied few seconds after boot with static networking #1140

Closed
basvdlei opened this Issue Feb 26, 2016 · 7 comments

Comments

Projects
None yet
5 participants
@basvdlei

basvdlei commented Feb 26, 2016

Since our beta machines have been upgraded to 899.8.0, the DNS servers entries disappear from /etc/resolv.conf a few seconds after boot.

We are running with a static networking setup as described here.

Sample from cloudconfig:

write_files:
- path: /etc/systemd/network/static.network
  permissions: "0644"
  content: |
    [Match]
    Name=en*

    [Network]
    Address=172.21.40.112/23
    Gateway=172.21.41.254
    DNS=171.21.99.200
    DNS=171.21.99.201
coreos:
  units:
  - name: systemd-networkd.service
    command: start

It seems the fix coreos/systemd#30 for #1081 broke static networking setups. Apparently systemd-resolved uses the state files for updating resolv.conf.

Systemd-networkd stops a few seconds after boot because there are no DHCP leases (this 'feature' was introduced in v219, networkd stops when idle.) When restarting systemd-networkd.server the resolv.conf is correctly updated, but emptied again a few seconds later.

@stelund

This comment has been minimized.

stelund commented Feb 26, 2016

I can confirm the issue on my coreos 899.8.0 with static network too.

@crawford

This comment has been minimized.

Member

crawford commented Feb 26, 2016

Let's close this once it's backported to Beta. /cc @mischief

@mischief

This comment has been minimized.

mischief commented Feb 26, 2016

we're working on getting alpha/beta out that reverts coreos/systemd#30, but in the meantime you can roll back via https://coreos.com/os/docs/latest/manual-rollbacks.html. you will probably want to disable either locksmithd or update-engine temporarily until the update goes out. i'll leave a note when alpha and beta are ready.

@basvdlei

This comment has been minimized.

basvdlei commented Feb 26, 2016

Thanks for the update! I'm already glad we caught this before it could get into stable.

@larskluge

This comment has been minimized.

larskluge commented Feb 26, 2016

In case somebody else is running into massive issues b/c of this, here is a quick (tmp) fix:

sudo bash -c 'rm /etc/resolv.conf && echo nameserver 8.8.8.8 > /etc/resolv.conf'

Once Beta is fixed, the file has to be removed & the symlink restored. Thanks @mischief and wCPO for your help!

@crawford

This comment has been minimized.

Member

crawford commented Feb 26, 2016

Alpha was rolled out earlier today. Still waiting on the Beta to pop out of the build servers.

@mischief

This comment has been minimized.

mischief commented Feb 29, 2016

beta went out earlier today - should be fixed. ping back if it's still a problem.

@mischief mischief closed this Feb 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment