Open DistroByte opened 1 year ago
In the consul.hcl
file, add a
recursors = ["192.168.1.6"] # adds DNS forwarding for non-`.consul` domains
resolv.conf
should contain the following
nameserver 127.0.0.53 # Consul agent DNS address
Consul must exist on the node in order for consul DNS resolution to work on that node
Docker won't recognise the difference between the host resolver (which forwards upstream) and a configured systemd resolver with Consul. See here
resolv.conf
gets overwritten when getting data from dhcp, two commands will disable dhclient from messing with the file.
echo 'make_resolv_conf() { :; }' > /etc/dhcp/dhclient-enter-hooks.d/leave_my_resolv_conf_alone
chmod 755 /etc/dhcp/dhclient-enter-hooks.d/leave_my_resolv_conf_alone
enabling this disables the ability to have single names for hosts on the network.
dionysus
no longer resolves for some reason, will require some more investigation.
Consul can be used to resolve DNS queries for services registered to it.