Linux CentOS 7 - Configuring a cache-only DNS
Configure a cache only DNS server which forwards requests to the well known Google DNS server.
On system1
Install the unbound package# yum install -y unbound
Enable and start the service
# systemctl enable unbound && systemctl start unbound
Adjust the configuration file
# vim /etc/unbound/unbound.conf
interface: 0.0.0.0 ## all interfaces
access-control: 0.0.0.0/0 allow ## from all networks
forward-zone
name: "." ## from any domain
forward-addr: 8.8.8.8 ## DNS server towards which all requests will be forwarded
Check configuration
# unbound-checkconf
Modify the DNS server on the interface configuration
# vim /etc/sysconfig/network-scripts/ifcfg-ens33
DNS1: 192.168.189.140
DNS2: 8.8.8.8
Restart the network service
# systemctl restart network
Populate the cache
# ping cnn.com
# ping cisco.com
# ping juniper.net
# ping redhat.com
# ping centos.org
Check the cache has been populated
# dig cnn.com
Dump the cache
# unbound-control dump-cache
Save the cache in a file
# unbound-control dump-cache > cachefile
Load the cachefile into memory
# unbound-control dump-cache < cachefile
If you experience problems with this configuration, just let me know.
Commenti
Posta un commento