RHEL7: Configure a caching-only name server.

Share this link

Note: This is a RHCE 7 exam objective.

Presentation of Caching-only Name Server

A cache-only name server keeps a cache of all the results of the previous requests to the root DNS servers.

Configuration Procedure

Install the bind package:

# yum install -y bind

Edit the /etc/named.conf file and change the listen-on option from 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;

Check the configuration file:

# named-checkconf

Add a new service to the firewall:

# firewall-cmd --permanent --add-service=dns

Reload the firewall configuration:

# firewall-cmd --reload

Activate the DNS service:

# systemctl enable named

Start the DNS service:

# systemctl start named

Time to Test

Check the configuration:

# nslookup cnn.com
# dig @ cnn.com

Additional Resources

You can also read this nice article from Zytrax.com about the different DNS Configuration Types.
If you want to go any further, check the master DNS server tutorial.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Leave a Reply

8 Comments on "RHEL7: Configure a caching-only name server."

Notify of

Sort by:   newest | oldest
1 year 7 months ago

In one of the tutorials I have seen they are installing unbound instead of bind, do you thing from the RHCE perspective it will matter to install bind or unbound?

5 months 22 days ago

What if I put my interface ip address in listen-on port directive and add my network ip in allow-query directive during the exam even if not asked in the question?
Because ‘any’ means no restriction.

2 months 28 days ago

why set dnssec-validation to no?

5 days 22 hours ago

Hi Guys,
I haven’t seen any DNS question on RHCE mock test. Do you think that might be included in the exam ?

Thank you

5 days 7 hours ago

It might be as it’s a part of RHCE exam objectives.

I’ve put a sample RHCE example exam here: https://www.lisenet.com/2016/rhce-sample-exam-for-rhel-7/ feel free to give it a try.


RHCSA7: Task of the day

Allowed time: 5 minutes.
Set up time services pointing to default time servers.

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a default secure MariaDB database called maria with a user named muser with all privileges.

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 ...