Notes on setting up DNS in Linux

We generally need to set DNS in Linux, but we need to pay attention to some issues when setting up, so as to avoid unnecessary problems,

So what are the considerations for setting up DNS in Linux? Let's take a look below.

First, the installation of bind

Second, check the status of bind-chroot, if enabled, then use the command "bind-chroot-admin -d" to close

Third, the main configuration file named.conf needs to be manually created and can be copied and generated

#cp /usr/share/doc/bind-9.3.3/sample/etc/named.conf /etc/named.conf Copy the sample to generate the main configuration file and compile the main configuration file named.conf ";" At the end, "//" is the comment content)

// Red Hat BIND Configuration Tool
//
// Default initial "Caching Only" name server configuration
//

options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/

// You can add the content of forwarders here

Forwards{219.146.0.130;219.150.32.132;};

allow-query {any;}; // Whether to be queried, allow

allow-transfer {none;}; // Whether to allow zone transfer, not allowed by default

// query-source address * port 53;
};

// About the setting of root (.)

zone "." IN {
type hint;
file "named.root";
};

zone "localdomain." IN {
type master;
file "localdomain.zone";
allow-update { none; };
};

// About the positive and negative solutions of the local localhost

zone "localhost." IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa." IN {
type master;
file "named.local";
allow-update { none; };
};

// IPV6 parsing file

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa." IN {
type master;
file "named.ip6.local";
allow-update { none; };
};

// Broadcast file

zone "255.in-addr.arpa." IN {
type master;
file "named.broadcast";
allow-update { none; };
};

zone "0.in-addr.arpa." IN {
type master;
file "named.zero";
allow-update { none; };
};

// Some encrypted data of DNS

include "/etc/rndc.key";

zone " " IN {
type master;
file " ";
allow-update {none;};
};
zone "0.0.10.in-addr.arpa" IN {
type master;
file "named.cvc.com.rev";
allow-update {none;};
};
// This part is added manually. The domain "cvc.com" and the corresponding reverse query domain are defined. "Type master" indicates that the machine is in the two domains "zrs.com" and "0.0.10.in-addr.arpa"

The main dns.html "target =" _ blank "> dns server (primary name server)." Named.cvc.com "and" named.cvc.com.rev "are the log files of the domain.

Created by myself. All self-created parsing files are placed under the / var / named folder by default.

Fourth, create named.cvc.com.rev files

$TTL 86400
@ IN SOA cvc.com. root.cvc.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum


IN NS cvc.com.
IN NS 192.168.1.1
www IN A 192.168.1.1

 

named.cvc.com.rev

$TTL 86400
@ IN SOA cvc.com. root.cvc.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS cvc.com.
6 IN PTR cvc.com.

5. Modify local DNS information

vi / etc /

nameserver 192.168.1.1

The above is about the precautions for setting DNS in Linux. I hope to help everyone. I will do my best to answer for you. Thank you for your continued support.

 

CN2 test IP of Hong Kong large bandwidth computer room: 27.124.18.216;

International bandwidth test: 27.124.9.10

Guess you like

Origin www.cnblogs.com/sha1234/p/12751522.html