Set up dns server-domain name resolution

Keywords: DNS yum

1. Background Description

Deployed services require domain name access. Configuration in the host file is OK, but if more than one computer accesses, you need to modify all the host files manually. If you add a domain name one day, you need to modify all the host files manually.

2. Set up dns services

The best way to solve the above problem is to set up a dns server for domain name resolution. The advantage of this is that even if you modify the domain name, you don't have to modify the host file, not to mention each one.

3. Steps

  • yum installation
yum install bind bind-utils
  • Restart after installation
service named start

  • Modify Profile-named.conf
    Restart is OK, installation is OK, here are the things to modify the configuration file.
[root@kafzook6 named]# cat /etc/named.conf 

options {
    listen-on port 53 { any; };
    listen-on-v6 port 53 { ::1; };
    directory   "/var/named";
    dump-file   "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query     { any; };
    recursion yes;
        forwarders {

    dnssec-enable yes;
    dnssec-validation yes;

    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";

    managed-keys-directory "/var/named/dynamic";

logging {
        channel default_debug {
                file "data/";
                severity dynamic;

zone "." IN {
    type hint;
    file "";

zone "" IN {
type master;
#This file we need to configure
file "";
allow-update { none; };

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
  • To file
[root@kafzook6 named]# cat

$TTL 86400
@ IN SOA (
2016042112 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
43200 ;Minimum TTL
;Name Server Information
;IP address of Name Server
primary IN A
;A - Record HostName To Ip Address
@ IN A

4. Verify that the configuration was successful

[root@kafzook6 named]# dig

Successful configuration is indicated by the following

5. Restart Services

[root@kafzook6 named]# service named restart

Finally, configure the ipv4 address on your own computer as shown in the following figure:

Posted by pmt2k on Sat, 11 Jul 2020 09:06:06 -0700