DNS configuration in Fedora8-general Linux technology-Linux technology and application information. For details, refer to the following section. In order to differentiate each host in the network, a unique address must be assigned to each host. This address is called an "ip address ". However, these numbers are hard to remember, so they are replaced by domain names. When a host needs to communicate with other hosts, you can use the host name to query the IP address of the host to the dns server. The entire dns domain name system consists of the following four parts:
1. dns domain name space
2. Resource Records
3. dns Server
4. dns Client
In Linux, dns servers are usually implemented using the Bind program. Bind is short for Berkeley Internet Name Domain Service. It is an open source software for implementing dns servers. Bind was originally a postgraduate project funded by DARPA at Berkeley. After years of development, it has become the world's most widely used dns server software, currently, most dns servers on the Internet use Bind.
Dns server type:
1. Master Server
2. Slave Server auxiliary Server/Slave Server
3. caching only Server Cache Server
4. Forwarder Server forwarding Server
5. Stealth Server secret Server
**************************************** *******************
Dns BIND region type:
***************
Type description
Master primary dns Region
Slave is in the dns region and is controlled by the primary dns region.
Stub is similar to a slave region, but only the name of the dns server is saved.
Forward forwards any query requests to other servers
Hint root dnsInternet server set
**************************************** ******************
Common BIND configuration statements and options:
*********************
Statement description
/* Comment */C-style BIND comment
// Comments C ++ syntax-style BIND comments
# Annotation of Unix shell and Perl system-style BIND annotations
Acl-defined IP address matching list
Include contains an object
Key indicates the Key information used for identification and authorization.
Logging indicates the server log record content and log information source
Options Global server configuration Options and default values of other statements
Control declares the Control channel used by ndc software tools
Server Sets configuration parameters for a Server
Trusted-keys defines the dnsSEC key that is pre-configured to the server and trusted
Zone defines a region
Type indicates the type of a region.
File indicates a region file
Directory specifies the file directory in the region
Forwarders: list the dns servers whose host requests will be forwarded
Masters lists the dns master server hosts used as slave servers
Allow-transfer indicates that the host is allowed to accept requests sent from the region.
Allow-query indicates that the host is allowed to ask
Motify when data in the primary region can be changed or updated, the primary server is allowed to notify the slave server
**************************************** *****************
Resource Record type:
**************
Type description
Host A address, which maps host names to IP addresses
NS local domain authorization Name Server
Name of the CNAME specification, used to comment out the host alias
Start SOA authorization, start dns entries in the domain file, and specify the name server for the domain and other features (such as vertices and serial numbers)
Service Description known to WKS
PTR pointer record, execute Reverse Domain Name access, map IP address to host name
RP text string containing host contact information
HINFO host information
MINFO email address or email list information
MX email exchanger, which is sent to the remote site of the domain email server
TXT text string, usually host information
**************************************** *****************
I. Installation
[Root @ localhost ~] # Rpm-q bind
[Root @ localhost/] # cd/media/Fedora \ 8 \ i386 \ DVD/Packages/
[Root @ localhost Packages] # find.-name "bind *"
Bind-9.5.0-16.a6.fc8.i386.rpm
Bind-chroot-9.5.0-16.a6.fc8.i386.rpm
Bind-libs-9.5.0-16.a6.fc8.i386.rpm
Bind-utils-9.5.0-16.a6.fc8.i386.rpm
The virtual directory of the BIND program is/var/named/chroot/
For example,/etc/named. conf is actually/var/named/chroot/etc/named. conf.
For example, the true path of/var/named/is/var/named/chroot/var/named/
[Root @ localhost Packages] # rpm-ivh bind-libs-9.5.0-16.a6.fc8.i386.rpm
Warning: bind-libs-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Preparing... ######################################## ### [100%]
Package bind-libs-9.5.0-16.a6.fc8 is already installed
[Root @ localhost Packages] # rpm-ivh util-linux-ng-2.13-3.fc8.i386.rpm
Warning: util-linux-ng-2.13-3.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Preparing... ######################################## ### [100%]
Package util-linux-ng-2.13-3.fc8 is already installed
[Root @ localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm
Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Error: Failed dependencies:
Libmysqlclient. so.15 is needed by bind-9.5.0-16.a6.fc8.i386
Libmysqlclient. so.15 (libmysqlclient_15) is needed by bind-9.5.0-16.a6.fc8.i386
Libodbc. so.1 is needed by bind-9.5.0-16.a6.fc8.i386
Libpq. so.5 is needed by bind-9.5.0-16.a6.fc8.i386
Mysql is needed by bind-9.5.0-16.a6.fc8.i386
Postgresql is needed by bind-9.5.0-16.a6.fc8.i386.
UnixODBC is needed by bind-9.5.0-16.a6.fc8.i386
[Root @ localhost Packages] # rpm-ivh mysql-libs-5.0.45-4.fc8.i386.rpm
Warning: mysql-libs-5.0.45-4.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Preparing... ########################################
### [100%]
1: mysql-libs ##################################### ###### [100%]
[Root @ localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm
Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Error: Failed dependencies:
Libodbc. so.1 is needed by bind-9.5.0-16.a6.fc8.i386
Libpq. so.5 is needed by bind-9.5.0-16.a6.fc8.i386
Mysql is needed by bind-9.5.0-16.a6.fc8.i386
Postgresql is needed by bind-9.5.0-16.a6.fc8.i386.
UnixODBC is needed by bind-9.5.0-16.a6.fc8.i386
[Root @ localhost Tuxtools] # rpm-ivh unixODBC-2.2.12-5.fc8.i386.rpm
Warning: unixODBC-2.2.12-5.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Preparing... ######################################## ### [100%]
1: unixODBC ####################################### #### [100%]
[Root @ localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm
Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Error: Failed dependencies:
Libpq. so.5 is needed by bind-9.5.0-16.a6.fc8.i386
Mysql is needed by bind-9.5.0-16.a6.fc8.i386
Postgresql is needed by bind-9.5.0-16.a6.fc8.i386.
[Root @ localhost Tuxtools] # rpm-ivh postgresql-libs-8.2.7-1.fc8.i386.rpm
Warning: postgresql-libs-8.2.7-1.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Preparing... ######################################## ### [100%]
1: postgresql-libs ##################################### ###### [100%]
[Root @ localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm
Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Error: Failed dependencies:
Mysql is needed by bind-9.5.0-16.a6.fc8.i386
Postgresql is needed by bind-9.5.0-16.a6.fc8.i386.
[Root @ localhost Tuxtools] # rpm-ivh postgresql-8.2.7-1.fc8.i386.rpm
Warning: postgresql-8.2.7-1.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Preparing... ######################################## ### [100%]
1: postgresql ####################################### #### [100%]
[Root @ localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm
Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Error: Failed dependencies:
Mysql is needed by bind-9.5.0-16.a6.fc8.i386
[Root @ localhost Packages] # rpm-ivh mysql-5.0.45-4.fc8.i386.rpm
Warning: mysql-5.0.45-4.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Preparing... ######################################## ### [100%]
1: mysql ####################################### #### [100%]
[Root @ localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm
Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA sigNature: NOKEY, key ID 4f2a6fd2
Preparing... ######################################## ### [100%]
1: bind ####################################### #### [100%]
[Root @ localhost ~] # Rpm-q bind
Bind-9.5.0-16.a6.fc8
2. Start the dns server after installation and test the loop
[Root @ localhost etc] #/etc/rc. d/init. d/named start
Start named: [OK]
[Root @ localhost etc] # nslookup
> Localhost
Server: 127.0.0.1
Address: 127.0.0.1 #53
Name: localhost
Address: 127.0.0.1
> 127.0.0.1
Server: 127.0.0.1
Address: 127.0.0.1 #53
1.0.0.127.in-addr. arpa name = localhost.
> Exit
[Root @ localhost etc] #/etc/rc. d/init. d/named stop
Stop named: [OK]
Iii. Modify the network configuration script file (/etc/sysconfig/network-scripts/ifcfg-eth0 ):
[Root @ localhost ~] # Cd/etc/sysconfig/network-scripts/
After modification
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE = eth0
BOOTPROTO = static
HWADDR = 00: 0C: 29: 65: 21: 05
BROADcaST = 192.168.1.255
IPADDR = 192.168.1.6
NETMASK = 255.255.255.0
NETWORK = 192.168.1.1
ONBOOT = yes
4. Modify the IP address of the Local Domain Name Server (/etc/resolv. conf ):
Domain July com
Nameserver 192.168.1.6
Demonstration/usr/share/doc/bind-9.5.0/sample
[Root @ localhost etc] # cp named. conf named. conf. old
Modify the named. conf file (/etc/named. conf ):
Listen-on port 53 {127.0.0.1 ;};
Listen-on-v6 port 53 {: 1 ;};
In Fedora 8, port 53 is opened only on the loopback address 127.0.0.1 and: 1 (IPV6 loopback address) by default. If you want to enable port 53 on all addresses, you should change it:
Listen-on port 53 {any ;};
Listen-on-v6 port 53 {any ;};
Allow-query {localhost ;}
;
By default, the dns server in Fedora 8 only allows the 127.0.0.1 client (that is, the Local Machine) to initiate a query. Generally, we need to allow query by all users, because the modification should be changed:
Allow-query {any ;};
5. Set the main region (/etc/named. conf ):
To facilitate configuration and reduce errors, copy and modify the following information from the system (127.0.0.1) loop/etc/named. rfc1912.zones file to the named. conf file: named. rfc1912.zones File
Zone "localhost" IN {
Type master; note: "type" and "file" are required. "type" is used to specify the region type (master, slave, stub, forward, hint)
File "named. localhost"; Note: used to specify the name of the region file
Allow-update {none ;}; Note: Region replication is not allowed,
};
Zone "1.0.0.127.in-addr. arpa" IN {
Type master;
File "named. loopback ";
Allow-update {none ;};
};
Modify
Zone "July com" IN {
Type master;
File "July com. zone ";
Allow-update {none ;};
};
Zone "1.168.192.in-addr. arpa" IN {
Type master;
File "1.168.192.arpa ";
Allow-update {none ;};
};
6. Create a region file in (/var/named ):
[Root @ localhost ~] # Cd/var/named/
To facilitate configuration and reduce errors, copy the system (127.0.0.1) loop file (Forward region file/var/named. localhost to the region file/var/named. loopback)
[Root @ localhost named] # cp named. localhost j1_com. zone
[Root @ localhost named] # cp named. loopback 1.168.192.arpa
July com. zone original file content
$ TTL 1D
@ In soa @ rname. invalid. (Note: Authorization starts. Specify the name server.
0; the serial number corresponding to the modification when serial is added
1D; refresh is the interval for refreshing SOA Information
1 H; retry is the frequency of contact with the authorization Server
1 W; expire is the time interval for saving the information about the region from the server without updating it.
3 H); minimum is the time for recording survival in the region
NS @ note: this domain authorizes the name server
A 127.0.0.1 Note: Host address, ing host name to IP Address
AAAA: 1
July com. zone modified File Content
$ TTL 1D
Jw.com. in soa dns.jw.com. admin.jw.com .(
2008041201; serial
1D; refresh
1 H; retry
1 W; expire
3 H); minimum
July com. in ns dns.july COM.
Dns.jw.com. in a 192.168.1.6
Www.july com. in a 192.168.1.6
Bbs.jw.com. in a 192.168.1.6
Blog.jw.com. in a 192.168.1.6
Mail.jw.com. in a 192.168.1.6
Jw.com. in mx 10 mail.jw.com.
Aaa.jw.com in cname www.jw.com.
1.168.192.arpa original file content
$ TTL 1D
@ In soa @ rname. invalid .(
0; the serial number corresponding to the modification when serial is added
1D; refresh is the interval for refreshing SOA Information
1 H; retry is the frequency of contact with the authorization Server
1 W; expire is used to save information about the region from the server,
Without updating the time interval
3 H); minimum is the time for recording survival in the region
NS @
PTR localhost. Note: pointer record, execute Reverse Domain Name access, map IP address to host name
1.168.192.arpa modified File Content
$ TTL 1D
1.168.192.in-addr. arpa. in soa dns.jw.com. admin.jw.com .(
2008041201; serial
1D; refresh
1 H; retry
1 W; expire
3 H); minimum
1.168.192.in-addr. arpa. in ns dns.jw.com.
6 in ptr dns.jw.com.
6 in ptr www.jw.com.
6 in ptr bbs.jw.com.
6 in ptr blog.jw.com.
6 in ptr mail.jw.com.
7. Modify the file group:
[Root @ localhost named] # chgrp named jw.com. zone
[Root @ localhost named] # chgrp named 1.168.192.arpa
[Root @ localhost ~] #/Etc/rc. d/init. d/named start
Start named: [OK]
8. Test
[Root @ localhost ~] # Nslookup
> Localhost
Server: 192.168.1.6
Address: 192.168.1.6 #53
Name: localhost
Address: 127.0.0.1
> 127.0.0.1
Server: 192.168.1.6
Address: 192.168.1.6 #53
1.0.0.127.in-addr. arpa name = localhost.
> Www.jw.com Note: Test host address A resource record
Server: 192.168.1.6
Address: 192.168.1.6 #53
Name: www.jw.com
Address: 192.168.1.6
> Dns.jw.com
Server: 192.168.1.6
Address: 192.168.1.6 #53
Name: dns.jw.com
Address: 192.168.1.6
> 192.168.1.6 Note: Test reverse parsing pointer PTR resource records
Server: 192.168.1.6
Address: 192.168.1.6 #53
6.1.168.192.in-addr. arpa name = www.jw.com.
6.1.168.192.in-addr. arpa name = bbs.jw.com.
6.1.168.192.in-addr. arpa name = blog.jw.com.
6.1.168.192.in-addr. arpa name = dns.jw.com.
> Set type = ns Note: Test name server NS resource records
> July com
Server: 192.168.1.6
Address: 192.168.1.6 #53
July com nameserver = dns.jw.com.
> Set type = mx Note: test the MX Resource Record of the email exchanger.
> July com
Server: 192.168.1.6
Address: 192.168.1.6 #53
July Com mail exchanger = 10 mail.jw.com.
> Set type = soa Note: test the SOA Resource Record of the starting authorization Organization
> July com
Server: 192.168.1.6
Address: 192.168.1.6 #53
July com
Origin = dns.jw.com
Mail addr = admin.jw.com
Serial = 2008041201
Refresh = 86400.
Retry = 3600.
Expire = 604800
Minimum= 10800
> Set type = cname Note: CNAME Resource Record Test alias
> Aaa.jw.com
Server: 192.168.1.6
Address: 192.168.1.6 #53
Aaa.jw.com.jw.com canonical name = www.jw.com.
> Exit
9. Close the service
[Root @ localhost ~] #/Etc/rc. d/init. d/named stop
Stop named: [OK]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.