splitdns.guide A guide by Firezone

Split DNS, one name at a time

Split DNS sends the names you own to a resolver inside your network, and it sends all other names to a public resolver. This guide shows how the split works, where it breaks, and how to control it for each name.

See how Firezone resolves DNSBook a demo

How a split DNS query travelsAn app on a laptop asks a resolver in the Firezone Client for a name. The Client sends names that match a Resource through a tunnel to a Gateway in the private network, and the Gateway asks the internal DNS server. The Client sends all other names to the public resolver.LaptopInternetPrivate networkqueryno matchmatchlookuptrafficAppasks for a nameClient resolverchecks each queryPublic resolverall other namesGatewayresolves on siteInternal DNSknows private nameswiki.corp10.0.4.20
  1. The Client sees each query

    A small resolver in the Firezone Client receives all DNS queries on the device.

  2. Other names stay public

    A name that matches no Resource goes to the resolver that the device already uses.

  3. Your names go inside

    A name that matches a Resource resolves on the Gateway, with the DNS servers of that network.

  4. Traffic follows the name

    The app gets an address that routes through the tunnel to that one service.

What split DNS is

Split DNS is a setup where the answer to a DNS query depends on who asks, or on which name they ask for. People also call it split-horizon DNS or split-brain DNS.

The term covers two different designs:

  • Split-horizon DNS. One name has two answers. app.example.com gives a private address to people inside the network and a public address to all other people.
  • Conditional forwarding. A device sends queries for some domains to an internal resolver, and it sends all other queries to a public resolver. Most VPN products mean this design when they say split DNS.

Both designs have the same goal. Your team can find private services by name, and you do not publish those names to the internet.

Why teams use split DNS

The alternative to split DNS is to send every query from a remote device to the company resolver. That setup is simple, but it has a cost.

  • Speed. A query for a public website makes a round trip through the office before it gets an answer.
  • Privacy. The company resolver sees the personal browsing of each remote worker.
  • Reliability. If the tunnel or the internal resolver stops, the device cannot resolve any name.

With split DNS, only the queries for your private names go to the internal resolver. All other queries use the fast path that the device already has.

Where split DNS breaks

Split DNS has a small number of failure modes, and most teams find all of them.

DNS leaks

A DNS leak occurs when a query for a private name goes to a public resolver. The public resolver learns the names of your internal systems, and the user gets no answer. A leak is common when the operating system prefers a different network interface, or when a browser uses its own DNS over HTTPS resolver.

Search domains

People type wiki, not wiki.corp.example.com. A search domain adds the missing suffix. If the remote device does not have the same search domain as the office, short names stop working.

Shared addresses

Two internal names frequently point to one address, for example two web apps behind one reverse proxy. A VPN that routes by IP address cannot tell the two apps apart. If a user can reach one app, the user can reach the two apps.

Stale answers

A device that moves between the office and a home network can keep an answer from the wrong side of the split. The cached answer is correct for a network that the device is no longer in.

How Firezone does split DNS

Firezone splits DNS for each name, not for each network. You add a DNS Resource such as **.corp.example.com, and you write a Policy that says which group can use it.

The Firezone Client then does this work on each device:

  1. A small resolver in the Client receives all DNS queries on the device.
  2. If a name matches no Resource, the resolver sends the query to the default resolver of the device, or to the upstream resolvers that you set.
  3. If a name matches a Resource, the Client gives the app an address that Firezone owns. The Gateway then resolves the name with the DNS servers of its own network.
  4. The Gateway sends traffic for that address to the real service, and to no other service.

This design removes the shared address problem. Each DNS Resource gets its own address on the device. Two apps on one server can have two different Policies. The internal resolver also never needs a route from the remote device, because the Gateway asks it.

The DNS resolution sequence in the Firezone documentation gives each step in detail.

Try the match rules

These rules use the pattern syntax of Firezone DNS Resources. One asterisk matches one label. Two asterisks match any number of labels. When two rules match, Firezone uses the more specific rule. An exact name comes first, then a rule with one asterisk, then a rule with two asterisks.

DNS ResourceWhere the query resolves
**.corp.example.comOn the Gateway in the office Site, with the internal resolver
db.prod.corp.example.comOn the Gateway in the production Site, for the database team only
*.example.comOn the Gateway in the cloud Site, with the VPC resolver
All other namesOn the public resolver that the device already uses

Set up split DNS that does not leak

These steps apply to any product. The links show where to do each step in Firezone.

  1. Make a list of your private zones. Write down each internal domain, and the resolver that knows it.
  2. Give each zone to the smallest group. In Firezone, add a DNS Resource for each zone, then write a Policy for each group.
  3. Set the search domain. Use the same suffix that the office uses, so that short names continue to work. See Configure DNS.
  4. Select the resolver for public names. Keep the default of each network, or encrypt the queries with DNS over HTTPS, or use your own resolvers to block malware domains.
  5. Test from outside. Resolve one private name and one public name from a home network. Make sure that each query went to the correct resolver.

Split DNS in a legacy VPN, a mesh VPN, and Firezone

The three approaches split DNS at different levels. The level decides how precise your access rules can be.

Legacy VPNMesh VPNFirezone
What decides the resolverOne setting for each tunnelA domain suffixEach DNS Resource
Who asks the internal resolverThe remote deviceThe remote deviceThe Gateway, inside the network
Separate rules for two names on one IPNoNoRoutes by IP addressYesEach name gets its own address
Wildcard namesPartialSuffix onlyPartialSuffix onlyYesOne label, many labels, or one character
Public queries stay off the tunnelPartialOnly with split tunnelYesYes
Encrypted public queriesNoPartialYesDNS over HTTPS

The table describes the usual design of each category. A specific product can be different. Read the documentation of the product before you decide.

Common questions

Is split DNS the same as split tunneling?

No. Split tunneling decides which packets go through the tunnel. Split DNS decides which resolver answers a query. The two features work together. If you use split tunneling without split DNS, private names do not resolve.

Is split-horizon DNS a security feature?

No, not by itself. Split-horizon DNS hides the names and the addresses of internal systems, which is useful. It does not stop a person who knows the address. Use an access policy for each service to control who can connect.

Why does a private name resolve to an address that starts with 100.96?

Firezone gives each DNS Resource its own address on the device, from the range 100.96.0.0/11. The Gateway changes that address to the real address of the service. This design lets two names on one server have different Policies.

Does split DNS work with DNS over HTTPS in the browser?

A browser that uses its own DNS over HTTPS resolver does not use the system resolver, so private names can fail. Set DNS over HTTPS for the full device as an alternative. Firezone can send the public queries of each Client to a DNS over HTTPS provider.

Do I need to change my internal DNS servers?

No. The Firezone Gateway uses the resolver that its host already uses. Your internal zones, records, and servers stay the same.

Give each private name its own rule

Firezone is zero trust access built on WireGuard. Add a DNS Resource, write a Policy, and your team resolves private names from any network. The Starter plan is free.

See plans and pricingBook a demo