DistroByte / docs

HomeLab Documentation for my own reference
https://docs.james-hackett.ie
3 stars 1 forks source link

Consul DNS #21

Open DistroByte opened 1 year ago

DistroByte commented 1 year ago

Consul can be used to resolve DNS queries for services registered to it.

DistroByte commented 1 year ago

This doc from Hashicorp here and this configuration option in the consul agent here are what allowed me to do this

DistroByte commented 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
DistroByte commented 1 year ago

Consul must exist on the node in order for consul DNS resolution to work on that node

DistroByte commented 1 year ago

Docker won't recognise the difference between the host resolver (which forwards upstream) and a configured systemd resolver with Consul. See here

DistroByte commented 1 year ago

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
DistroByte commented 1 year ago

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.