app.example.com answers 10.0.0.10 for office computers and
203.0.113.10 for everyone else.
Use a view when the same hostname must reach a service by its private address on your LAN or VPN,
and by its public address from the internet.
Set up a view
1
Create the view
Open DNS → Views and click Add view (superadmins). Give it a name, for example
Internal, an optional description, and its client networks, one per line, such as
10.0.0.0/8 and 192.168.0.0/16.2
Add view-only records
In a zone, add or edit a record and choose Answer → Only the Internal view. Such records
carry a badge with the view’s name in the record table.
3
Test from both sides
Query the name from a client inside the view’s networks and from one outside it.
dnz view rm deletes the view and its records; its networks then get the default answers. See
CLI: zones and records.
A network can belong to only one view. When networks overlap, a client belongs to the view with
the most specific network.
How answers work
For a client in a view:- If the queried name has records in that view, the client gets only those, for every type. The name’s default records are hidden from this client.
- If not, the client gets the default records, the same as everyone.
A view replaces a name’s records as a whole. If
app.example.com has an A and an AAAA record by
default, and the Internal view adds only an A record, clients in the view get no AAAA for that
name. Add every type the view needs.What views leave out
These only use a zone’s default records, so internal addresses don’t leak:- zone file export and import (Import and export),
- Copy to local and Push to Cloudflare,
- zone transfers to secondaries (Replication),
- Dynamic DNS and ACME,
- dynamic updates (RFC 2136), which never touch view records.