DNS: Configure a caching-only name server to forward DNS queries

Share this link

Install the bind package:

# yum install -y bind

Edit the /etc/named.conf file and change the ‘listen-on‘ option from 127.0.0.1 to any:

listen-on port 53 { any; };

In the same file, change the ‘allow-query‘ option from localhost to any:

allow-query { any; };

In the same file, disable the ‘dnssec-validation‘ option:

dnssec-validation no;

Still in the same file, below the ‘recursion‘ option, add the two following lines (with 192.168.1.1 being the DNS IP address of your operator):

forward only;
forwarders { 192.168.1.1; };

Check the configuration file:

# named-checkconf

Add two new rules to the firewall:

# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
# iptables -I INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT

Save the firewall configuration:

# service iptables save

Activate the DNS service:

# chkconfig named on

Start the DNS service:

# service named start

Check the configuration:

# nslookup cnn.com 127.0.0.1
# dig @127.0.0.1 cnn.com
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Leave a Reply

RHCSA7: Task of the day

Allowed time: 5 minutes.
Create two users "tom" and "engine". "tom" has the UID/GID 3000 and "engine" the UID/GID 4000. "engine" doesn't have an interactive shell.

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a NFS server that exports the /opt directory in read-only mode.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...

Archives