Skip to content

Configuring DNS on hosts

The DNS setting has DNClient point a host’s resolver at DNS servers on your Nebula network while the host is connected, so people can reach web-01.corp.example.com, or just web-01, instead of typing an overlay IP. You choose which domains go to your nameservers, or send them every lookup. When DNClient stops, it removes the DNS settings it applied.

DNS is part of advanced config, so you can set it on a host, a tag, or the whole network. For how Nebula applies each field on the host, see the dns reference.

The setting applies to macOS and Windows hosts running DNClient 1.0.0 and later. Linux hosts and mobile devices ignore it.

Managed Nebula doesn’t answer DNS queries for you. You need:

  • A DNS server that answers for your domains and that hosts can reach over Nebula, either at the overlay IP of a host that runs it or at an address behind a route. DNS for Nebula hosts using the API shows how to serve your host names from CoreDNS.
  • A firewall rule that allows port 53 over UDP and TCP from the hosts that will use the server. Add it to the DNS server’s role or tag, or, for a server behind a route, to the route.

Set DNS in the DNS section of a host’s Advanced tab, or add it to a tag or network with Add config. Where advanced config lives covers each place.

The DNS section of a host's Advanced tab. DNS enabled is set to True, DNS nameservers to 100.100.0.53, and DNS search domains to corp.example.com. DNS match domains is empty and Match all domains is unchecked.
  • DNS enabled: True to configure the host’s resolver, False to leave it alone. Required if any other field is set.
  • DNS nameservers: the IPv4 or IPv6 addresses of your DNS servers, separated by commas, with no port. At least one is required when DNS is enabled.
  • DNS match domains: the domains whose lookups go to your nameservers, separated by commas. Leave it empty to use the search domains, or turn on Match all domains to send every lookup to your nameservers. DNS needs match domains, search domains, or Match all domains.
  • DNS search domains: domains to try when someone looks up a bare name, such as web-01. When you list match domains, each search domain must fall under one of them.

The fields are saved as one setting, so a value on a host or tag replaces the network’s DNS entirely instead of merging nameservers or domains. Which value a host gets follows the usual precedence.

DNClient applies a DNS change without a restart. Saving DNS on a tag or network that has hosts still shows the Restart dnclient dialog, which DNClient hosts can ignore.

To send lookups for one internal domain to your DNS server, set DNS enabled to True, DNS nameservers to the server’s overlay IP, such as 100.100.0.53, and DNS search domains to corp.example.com.

With match domains left empty, corp.example.com is also the match domain. Hosts resolve web-01.corp.example.com and web-01 through your server, and every other name as before. Because only your domain depends on the tunnel, this split DNS setup suits laptops that move between networks.

Set it on a tag, such as dns:corp, and assign the tag to the hosts that should use it. To cover every host in the network, set it on the network instead.

Turn on Match all domains to send all of a host’s lookups to your nameservers, for example to apply your own filtering. If those nameservers are reachable only over Nebula, the host can’t resolve any name while its tunnel to them is down.

When a tag or the network sets DNS, open a host’s Advanced tab and set DNS enabled to False. A host’s own value wins, so DNClient leaves that host’s DNS alone.

To confirm the host received the setting, run dnclient info and look for the dns section. See Checking a host’s values.

For split DNS, you can also check what the operating system is using:

  • On macOS, run scutil --dns. Your nameservers appear in a resolver entry for each match domain.
  • On Windows, run Get-DnsClientNrptPolicy in PowerShell. Each match domain has a rule pointing at your nameservers.

If a name doesn’t resolve, check that the host can reach the DNS server over Nebula and that the server’s firewall rules allow port 53 from the host. Browsers and apps that use their own resolver or encrypted DNS can bypass these settings, so test with a command such as ping web-01.corp.example.com too.

DNS is the dns config override. Its value is an object with enabled, nameservers, match_domains, and search_domains, where the last three are arrays. An empty match_domains array is the same as Match all domains, and leaving match_domains out uses the search domains. For example, the split DNS example above on a tag:

{
"key": "dns",
"value": {
"enabled": true,
"nameservers": ["100.100.0.53"],
"search_domains": ["corp.example.com"]
}
}

See Setting advanced config with the API or Terraform for the endpoints on each level, and Config override keys for the value’s rules.