How to Change DNS on Cisco IOS / IOS XE Routers
By [FILL IN], [FILL IN] · Last updated
Configure the router as DNS forwarder and DHCP server handing out FirewallDNS.
Before you start
You need a FirewallDNS account (see pricing). Sign in to your dashboard, register your public IP address and copy your DNS server addresses. Replace <FIREWALLDNS-PRIMARY> and <FIREWALLDNS-SECONDARY> below with them.
Step by step
- Enter configuration mode with "configure terminal".
- Enable DNS lookup and set the name servers.
- Update the DHCP pool so clients receive the new DNS servers.
- Save with "write memory".
IOS CLI
conf t
ip domain lookup
ip name-server <FIREWALLDNS-PRIMARY> <FIREWALLDNS-SECONDARY>
ip dns server
ip dhcp pool LAN
dns-server <FIREWALLDNS-PRIMARY> <FIREWALLDNS-SECONDARY>
end
write memoryVerify it works
- Renew DHCP on a client (Windows:
ipconfig /renew, macOS: reconnect Wi-Fi). - Run
nslookup example.comand check which server answered. - Open the live log in your dashboard. New lookups should appear within seconds.