SoFunction
Updated on 2025-04-11

BIND&DNS Internal Training Tutorial 2

(6) Master server:

The master server is the authorization source for all information in a given domain. The domain information it loads comes from the domain administrator created by the domain administrator

and locally maintained disk files.

We use "" as an example, and we need five basic configuration files:

/etc/

/var/named/

/var/named/

/var/named/

/var/named/named.172.16.0

(6.1) Create or modify /etc/:

// generated by

options {

directory "/var/named";

/*

* 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.

*/

// query-source address * port 53;

};

//

// a PM nameserver config

Violators of all copyrights of Beijing Blue Pioneer Software Co., Ltd. will be prosecuted

Address: Beijing Station East Street, Beijing10 No. Hua'an Business Building6 layer

Website: post code:100005 The8 Pages total14 Page

Telephone:( 010 ) 65594026 fax:( 010 ) 65594064

//

zone '.' {

type hint;

file "";

};

zone '0.0.' {

type master;

file "";

};

//there are our primary zone files

zone "" {

type master;

file "";

};

zone '0.16.' {

type master;

file 'named.172.16.0';

};

The zone '' segment in the file is declared that this is used for the domain's master server, for the data of the domain

Load from /var/named/ file.

The zone '0.16.' segment in the file points to the mapped IP address 172.16.0.* to the hostname

document. The data used for this domain is loaded from the /var/named/named.172.16.0 file.

(6.2) Create or modify /var/named/

@ IN SOA . . (

2000051500 ; Serial

28800 ; Refresh

14400 ; Retry

3600000 ; Expire

86400 ) ; Minimum

IN NS .

1 IN PTR localhost.

Note: When modifying the named.* file, pay attention to increasing the Serial value every time you save it. For example, when using an absolute domain name, don't forget the '.' included in it.

The @ character in the resource record is converted to the current domain, IN means that the resource record uses the TCP/IP address, SOA means that the jurisdiction start record is... It is the standard name of the primary DNS server of this domain, followed by the contact.

EMAIL address, where the @ character must be replaced with '.'.

 

(6.3) Create or modify /var/named/

@ IN SOA . . (

2000051500 ; Serial

28800 ; Refresh

14400 ; Retry

3600000 ; Expire

86400 ) ; Minimum

IN NS .

ns A 172.16.0.1

ns2 A 172.16.0.11

www A 172.16.0.2

ftp CNAME .

mail A 172.16.0.3

MX 10 .

(6.4) Create or modify /var/named/named.172.16.0

@ IN SOA . . (

2000051500 ; Serial

28800 ; Refresh

14400 ; Retry

3600000 ; Expire

86400 ) ; Minimum

IN NS .

1 IN PTR .

11 IN PTR .

2 IN PTR .

3 IN PTR .

(7) Auxiliary server

The secondary server obtains a complete copy of the domain information from the primary server. It can also answer queries about the domain in an authorized manner. We use '' as an example, we need five basic configuration files:

/etc/

/var/named/

/var/named/

(7.1) Create or modify /etc/:

// generated by

options {

directory "/var/named";

/*

* 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.

*/

// query-source address * port 53;

};

//

// a SM nameserver config

//

zone '.' {

type hint;

file "";

};

zone '0.0.' {

type master;

file "";

};

//there are our slave zone files

zone "" {

type slave;

file "";

masters {172.16.0.1;};

};

zone '0.16.' {

type slave;

file 'named.172.16.0';

masters {172.16.0.1;};

};

 

In the file 'masters {172.16.0.1;};', the IP address is the IP address of the master server in your network. Copy the two files /var/named/ and /var/named/ from the main server. The actual running server can be one of the above configurations, or it can include multiple configurations at the same time, but all systems should run a parser.

Article entry: csh     Editor in charge: csh