Today we’ll take a look at setting up a caching only DNS server for the LFCS exam objectives.
First, install the necessary DNS packages: yum install -y bind bind-utils
.
Then you will have to do some editing in /etc/named.conf
. In particular, you are interested in the below:
1 2 3 |
|
The allow-query option deals with who can send queries to the server, while the allow-query-cache allows access to cached records
You have to ensure the named.conf file has the proper permissions. It needs to be owned by root and belong to the group named:
1 2 |
|
Check the SELinux contexts:
1 2 3 4 5 |
|
Check the config file for syntax errors before trying anything:
1
|
|
Start the DNS service:
1
|
|
Open port 53 on the firewall:
1
|
|
On the client, add the DNS server:
1
|
|
Restart the connection and NetworkManager. Check that the nameserver has been added in /etc/resolv.conf
. Now you can test it:
1 2 3 4 5 6 7 8 9 |
|
If you need to add a zone to your DNS server, take a look at the sample zone directives in /etc/named.rfc1912.zones:
1 2 3 4 5 |
|
You have to add a similar configuration for your zone inside /etc/named.conf
. Then you also have to create a zone file inside /var/named. For reference, look at an existing one:
1 2 3 4 5 6 7 8 9 10 11 |
|
This should be all that is needed in terms of DNS configuration for LFCS objectives.
1 2 3 4 5 6 7 8 9 10 |
|