Skip to content
This repository has been archived by the owner. It is now read-only.

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

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

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

basvdlei opened this issue Feb 26, 2016 · 7 comments

Comments

@basvdlei
Copy link

@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
Copy link

@stelund stelund commented Feb 26, 2016

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

@crawford
Copy link
Member

@crawford crawford commented Feb 26, 2016

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

@mischief
Copy link

@mischief 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
Copy link
Author

@basvdlei basvdlei commented Feb 26, 2016

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

@larskluge
Copy link

@larskluge 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
Copy link
Member

@crawford crawford commented Feb 26, 2016

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

@mischief
Copy link

@mischief 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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.