Skip to content
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

Consul DNS #21

Open
DistroByte opened this issue Nov 21, 2022 · 6 comments
Open

Consul DNS #21

DistroByte opened this issue Nov 21, 2022 · 6 comments
Assignees

Comments

@DistroByte
Copy link
Owner

DistroByte commented Nov 21, 2022

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

@DistroByte
Copy link
Owner Author

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

@DistroByte
Copy link
Owner Author

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
Copy link
Owner Author

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

@DistroByte
Copy link
Owner Author

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

@DistroByte
Copy link
Owner Author

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
Copy link
Owner Author

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.

@DistroByte DistroByte reopened this Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant