Installing and Configuring a Name Server
By default, you can use the BIND installation to configure a caching-only name server using
the configuration settings that are provided in the /etc/named.conf
file and
files that it includes. The following procedure assumes that you either use the default
settings or configure new named
configuration and zone files.
To configure a name server:
-
Install the bind package.
sudo dnf install bind
-
If
NetworkManager
is enabled on the system, edit the/etc/sysconfig/network-scripts/ifcfg-interface
file, and add the following entry:DNS1=127.0.0.1
This line causes
NetworkManager
to add the following entry to/etc/resolv.conf
when the network service starts:nameserver 127.0.0.1
This entry points the resolver at the local name server.
-
If you have disabled
NetworkManager
, edit the/etc/resolv.conf
file to include thenameserver 127.0.0.1
entry. -
If required, change the
named
configuration and zone files.See Configuring the named Daemon more details.
-
Configure the system firewall to accept incoming TCP connections to port 53 and incoming UDP datagrams on port 53:
sudo firewall-cmd --zone=zone --add-port=53/tcp --add-port=53/udp
sudo firewall-cmd --permanent --zone=zone --add-port=53/tcp --add-port=53/udp
For more information about securing the firewall, see Oracle Linux 9: Configuring the Firewall.
-
Restart the
NetworkManager
service and thenamed
services, and then configure thenamed
service to start following system reboots:sudo systemctl restart NetworkManager
sudo systemctl start named
sudo systemctl enable named