August 7, 2014

RHEL 6 Configure a Caching-Only Name Server to Forward DNS Queries

Installation

yum install bind bind-chroot bind-utils -y

Configuration

$ vi /etc/named.conf
...
    listen-on port 53 { any; };
    listen-on-v6 port 53 { any; };
...
    allow-query     { 192.168.1.0/24; };
    forwarders      { 192.168.1.1; };
...
    dnssec-validation no;
...

Start

service named restart; chkconfig named on

Test

$ nslookup www.sunet.se 192.168.1.11
Server:  192.168.1.11
Address: 192.168.1.11#53

Non-authoritative answer:
www.sunet.se canonical name = vision.sunet.se.
Name: vision.sunet.se
Address: 192.36.171.156

Firewall

$ vi /etc/sysconfig/iptables
...
-A INPUT -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT 
-A INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT
...

No comments: