DHCP and DNS Forwarding in VyOS
Contents
Prerequisites
- VyOS configured as per Setting Up VyOS as a Proxmox VM — specifically,
eth1assigned a static IP on the lab subnet
DHCP Pool
Running DHCP on the router keeps address assignment in the same place as routing. VyOS includes a DHCP server out of the box.
Official reference: VyOS DHCP Server
Enter configuration mode and define the subnet. Replace 10.x.x.x placeholders with your actual lab subnet values:
| |
default-router— the gateway handed to clients; the VyOS lab interface IPname-server— the DNS server handed to clients; points to VyOS, which handles forwarding as configured belowlease— lease duration in seconds;86400is 24 hoursrange 0— the dynamic pool; addresses below.100are left free for static mappings
Static Mappings
Servers that other services depend on — the NAS, Kubernetes workers, monitoring hosts — should always receive the same IP. Static mappings bind a MAC address to a fixed IP, served via DHCP:
| |
The name (nas, k8s-worker-01) is a local label used in lease logs. It appears in show dhcp server leases output, making it easier to track which host has which address.
DNS Forwarding
VyOS includes a DNS forwarder powered by PowerDNS Recursor. Configuring it on the lab interface means every DHCP client that receives 10.x.x.1 as its DNS server is automatically covered — no separate resolver needed.
Official reference: VyOS DNS Forwarding
| |
listen-address— the lab interface IP VyOS accepts DNS queries onallow-from— restricts queries to the lab subnet; anything outside this range is droppedname-server— upstream resolvers that unrecognised queries are forwarded to
Verifying
Check active DHCP leases:
| |
Test DNS forwarding from a lab host:
| |
A newly connected lab host should appear in the lease table within seconds. google.com should return a public A record via the upstream resolvers.
What’s Next
- Authoritative DNS with BIND — running a primary/secondary BIND9 pair on LXC for internal name resolution
- VRRP redundancy — adding a second VyOS instance for failover
- BGP peering with Kubernetes — dynamically routing Kubernetes service IPs through VyOS