Recently, with the help of the senior, DNS services were finally configured. Now, I will summarize my individuals, I hope to help friends who have just learned Linux like me.
test environment:
Operating system: redhat 7.2
First, instance environment:
1. A C-network segment address: 202.101.55.0
2. Company registration domain name: longyu.edu
3. Domain name server IP is: 202.101.55.1 Host Name: WWW
4. The servers to be parsed are:
Www.longyu.edu (web server)
Mail.longyu.edu (Email server)
Second, preparation before installation:
1. First install BIND
Here you can have two ways to install, one is to install the RPM package directly, and the other is self-compiled. I recommend installing an RPM package, which is convenient and more.
After the installation is complete, you should generate a named.conf file and / var / named directory in the / ECT directory.
2. Must ensure system / etc / with 2 files: /etc/resolve.conf and /etc/host.conf
The resolve.conf file is as follows:
Domain longyu.edu
Nameserve 202.101.55.1
The content of the / tele/host.conf file is as follows:
ORD HOSTS, BIND
Multi off
Third, the main configuration file of DNS / tele/named.conf
The name of the named.conf file is as follows:
Options {
Directory '/ VAR / Named';
}
Zone '.' {
Type hint;
File 'Named.ca';
}
Zone 'Localhost' in {
File "Localhost.zone"
Allow-update {none;};
}
Zone '0.0.127.in-addr.arpa' {
TYPE MASTER;
FILE 'Named.local';
}
ZONE 'longyu.edu' {
TYPE MASTER;
FILE 'longyu.edu';
}
Zone '55 .101.202.in-addr.Arpa '{
TYPE MASTER;
File '55 .101.202 ';
}
INCLUDE "/etc/rndc.key";
Note:
The first part of the file Option specifies that domain data files are stored in the / var / name directory, and the general situation does not make changes.
The second part of the file, ZONE "." Defines root domain information, that is, when the domain name server receives a domain name query, find that the customer wants the domain name that the customer wants the query is not the local domain name, it will check the inquiry / ETC The root domain name defined in /Named.ca until you finally get the domain name you want to query.
The third part of the file Zone "localhost" and zone "0.0.127.in-addr-arpa" defines the forward and reverse parsing of the local loop, generally not modified.
The fourth part of the file is the key, where we set the domain name we want.
Define information about the domain longyu.edu.
Master refers to the server as the primary domain server
TYPE specifies the nature of this
Hint fingers
Fourth, configure DNS forward domain name conversion data file /var/named/longyu.edu.
$ TTL 86400
$ Orlgin longyu.edu.
@ 1D in SOA ns.longyu.edu. Root.longyu.edu.
(42; serial (d.adams) 3h; Refresh
15m; Retry
1W; Expiry
1D;); minimum
@ 1D in ns longyu.edu.
@ 1D in mx 10 mail.longyu.edu.
1D in A 202.101.55.1
WWW 1D IN A 202.101.55.1
NS 1D IN A 202.101.55.1
Mail 1D IN A 202.101.55.1
Fives. DNS reverse domain name parsing transfer data file /VAR/NAMED / 202.101.55
TTL
@ In SOA ns.longyu.edu. Root.longyu.edu.
19997022700; Serial
28800; Refresh
14400; RETRY
3600000; EXPIRE
@ In ns longyu.edu.
1 in ptr longyu.edu.
2 in Prt mail.logyu.edu.
4 in prt ns.longyu.edu.
Note:
1. SOA is the command that the primary server must set, usually in the first line.
2. The front symbol "@" represents the domain currently jurisdiction. "In" represents the address category, here is fixed to "IN".
3. Fill in the domain name server, remember due to the special format of the DNS data file, in the end, we must add "·" we fill in ns.longyu.edu.
4. The D-mail address of the domain name server administrator, but note that the separator "@" in the E-mail address is used here, "·" is instead, and in the end, it is necessary to add ".", Here We write corresponding: "root.longyu.edu.
OK, it has been basically configured, the easiest way to test is ping longyu.edu, another method is Nslookup
I just learned Linux, maybe some places wrote wrong, I have forgotten the master's finger. I just want to help friends who have just learned Linux like me.