You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having a terrible time getting DNS forwarding to work on Ubuntu 17.10. I'm not an expert at this stuff, but I think the problems come down to the behaviour of systemd-resolved, and the way it takes ownership of the /etc/resolv.conf file.
Specifically, if I just follow the instructions on https://www.consul.io/docs/guides/forwarding.html , a dns lookup for consul.service.consul or any other consul subdomain fails. However, if I do dig -p 8600 consul.service.consul, it works fine. So consul is behaving correctly -- it's just that the port forwarding isn't working. This occurs with both dnsmasq and bind.
The problem seems to be that /etc/resolv.conf is symlinked to some file within systemd-resolved. After a lot of depressing reading, I guess this is a fairly infamous problem. If I set the /etc/resolv.conf to list 127.0.0.1 as the first nameserver, the port forwarding works okay.
Frustratingly, just disabling the systemd-resolved service doesn't put back the /etc/resolv.conf file --- it's still symlinked. So disabling the service leaves the system in a broken state. What seems to work is then replacing the symlink with an actual file, with the nameservers.
Here are the changes I've cobbled together my Packer image to get this working for me. I don't know whether this is an advisable solution. Hopefully the right thing to do can be added to the docs. Thanks!
@honnibal,
I have a few suggestions, in case you plan to do large scale stuff with your experiments:
Stick with an LTS version of Ubuntu, its less madness that way: currently 16.04, soon 18.04
Try using Ubuntu Server rather than the Desktop flavor.
Maybe just use CentOS 7 without NetworkManager.
You haven't mentioned what exactly you are trying to do, but there go the free suggestions. :) ;)
I've been having a terrible time getting DNS forwarding to work on Ubuntu 17.10. I'm not an expert at this stuff, but I think the problems come down to the behaviour of systemd-resolved, and the way it takes ownership of the
/etc/resolv.conf
file.Specifically, if I just follow the instructions on https://www.consul.io/docs/guides/forwarding.html , a dns lookup for
consul.service.consul
or any otherconsul
subdomain fails. However, if I dodig -p 8600 consul.service.consul
, it works fine. So consul is behaving correctly -- it's just that the port forwarding isn't working. This occurs with both dnsmasq and bind.The problem seems to be that
/etc/resolv.conf
is symlinked to some file withinsystemd-resolved
. After a lot of depressing reading, I guess this is a fairly infamous problem. If I set the/etc/resolv.conf
to list127.0.0.1
as the first nameserver, the port forwarding works okay.Frustratingly, just disabling the
systemd-resolved
service doesn't put back the/etc/resolv.conf
file --- it's still symlinked. So disabling the service leaves the system in a broken state. What seems to work is then replacing the symlink with an actual file, with the nameservers.Here are the changes I've cobbled together my Packer image to get this working for me. I don't know whether this is an advisable solution. Hopefully the right thing to do can be added to the docs. Thanks!
The text was updated successfully, but these errors were encountered: