DNS Forwarding in VyOS
Contents
Prerequisites
- VyOS configured as per Setting Up VyOS as a Proxmox VM — specifically,
eth1assigned an IP on the lab subnet - DHCP server configured on VyOS — recommended so that the DNS server IP is distributed to lab hosts automatically
Why DNS on VyOS
Without a DNS resolver on the lab network, devices either use a hardcoded public resolver or rely on the home router for name resolution. Running the forwarder directly on VyOS gives you:
- A single DNS server for all lab hosts to point at
- Static entries for internal services — no need for a separate DNS server just to resolve
nas.lab.local - A natural place to add per-domain forwarding rules later (e.g. forward
cluster.localto a Kubernetes CoreDNS instance)
VyOS includes a built-in DNS forwarder powered by PowerDNS Recursor, available without installing anything extra.
Official reference: VyOS DNS Forwarding
Enabling DNS Forwarding
Enter configuration mode and set up the forwarder:
| |
listen-address— the lab interface IP that VyOS will accept DNS queries onallow-from— restricts queries to your lab subnet; queries from outside this range are droppedname-server— upstream resolvers that unresolved queries are forwarded to
Static Host Entries
For internal services that only exist on the lab network, you can define static A records directly on VyOS rather than running a separate DNS server:
| |
Lab hosts can then reach nas.lab.local and router.lab.local by name. Add an entry per service — the domain (lab.local) and the hostnames are entirely up to you.
Pointing Lab Hosts at VyOS
Each lab host needs to use 10.x.x.1 as its DNS server. How you configure this depends on where DHCP is served:
If DHCP runs on VyOS — add the
name-serveroption to the subnet. See DHCP Server in VyOS for the full setup; the relevant line is:1set service dhcp-server shared-network-name lab subnet 10.x.x.0/24 name-server '10.x.x.1'If DHCP runs elsewhere — set
10.x.x.1as the DNS server in that DHCP configuration instead.
Verifying
From any lab host, confirm that forwarding and static entries both work:
| |
If forwarding is working, google.com resolves via the upstream resolvers. If static entries are working, nas.lab.local returns the IP you set.
What’s Next
- VRRP redundancy — adding a second VyOS instance for failover
- BGP peering with Kubernetes — dynamically routing Kubernetes service IPs through VyOS