We use Digital Ocean, which provides high speed internal networking in additional external networking. The internal network uses

Unfortunately, Digital Ocean does not provide split horizon DNS. We'd like to stand up our own DNS server to respond with the internal addresses when an internal server resolves another internal server and they both can talk over the network. We do not want our DNS server to be a single point of failure though, so we want to keep Digital Ocean's DNS servers in the configuration, but at a lower priority.

Is there a way to specify a priority of DNS Servers? For instance, for our domain www.example.com, could we direct those queries to our internal DNS first before trying Digital Ocean's DNS?

  • 1
    How is your networking configured currently? (systemd, /etc/network/interfaces, etc). – Seth Aug 16 at 16:15
  • Ubuntu 18.04 Uses Netplan, which then writes systemd-network configuration to ` /run/systemd/network/10-netplan-eth0.network`. Ubuntu 18.04 uses systemd 237 IIRC – Jonathan S. Fisher Aug 16 at 16:31

The nameservers are used in the order configured. If you configure the internal nameserver first and the Digital Ocean second, the systems will fail over to the second one if the first one does not respond.

After a failover the system (to my knowledge) does not automatically switch back to the first one. So a sudo netplan apply is necessary.

It only gets tricky nowadays because so many parts are (potentially) involved in the configuration (systemd-resolved, netplan, configuration in /etc/netplan/*.yaml, wich are overwritten by /etc/systemd/resolved.conf, and probably a dozen more that I am not aware of).

The best way to see what the final result of all the different configurations and services result in for the name resolution is systemd-resolve --status. Here are the important parts on one of my test systems: `...

     DNS Servers:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.