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
NetworkManageris enabled on the system, edit the/etc/sysconfig/network-scripts/ifcfg-interfacefile, and add the following entry:DNS1=127.0.0.1This line causes
NetworkManagerto add the following entry to/etc/resolv.confwhen the network service starts:nameserver 127.0.0.1This entry points the resolver at the local name server.
-
If you have disabled
NetworkManager, edit the/etc/resolv.conffile to include thenameserver 127.0.0.1entry. -
If required, change the
namedconfiguration 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/udpsudo firewall-cmd --permanent --zone=zone --add-port=53/tcp --add-port=53/udpFor more information about securing the firewall, see Oracle Linux 8: Configuring the Firewall.
-
Restart the
NetworkManagerservice and thenamedservices, and then configure thenamedservice to start following system reboots:sudo systemctl restart NetworkManagersudo systemctl start namedsudo systemctl enable named