How to Configure a Local DNS Server (Dnsmasq Docker) in GNS3
1. Configure the DNS Server(Dnsmasq Docker) eth0 with the following commands:
DNS Server Configuration:
/etc/network/interfaces
# Static config for eth0
auto eth0
iface eth0 inet static
address 192.168.122.100
netmask 255.255.255.0
gateway 192.168.122.1
up echo nameserver 192.168.122.1 /etc/resolv.conf – there’s a more than sign in the middle of 192.168.122.1 and /etc/resolv.conf. Just removed it because it’s not allowed.
/etc/hosts
192.168.122.10 R1.LAB R1
192.168.122.11 R2.LAB R2
2. Configure the two routers with the following commands:
R1 Configuration:
interface GigabitEthernet0/0
ip address 192.168.122.10 255.255.255.0
no shut
exit
!
ip domain-lookup(enabled by default)
ip name-server 192.168.122.100
ip route 0.0.0.0 0.0.0.0 192.168.122.1
end
wr
R2 Configuration:
interface GigabitEthernet0/0
ip address 192.168.122.11 255.255.255.0
no shut
exit
!
ip domain-lookup(enabled by default)
ip name-server 192.168.122.100
ip route 0.0.0.0 0.0.0.0 192.168.122.1
end
wr
3. Verify the configuration by pinging a couple of websites from the routers and DNS server.
ping google.com
ping cisco.com
ping R1 from R2 and vice versa
Troubleshooting commands:
“service dnsmasq restart” to restart the service on the DNS Server.
source by Learn Networking
linux dns server
