DNS role
Forward Analysis: Domain Name -> IP
Reverse lookup: IP -> domain name
DNS Management
IANA assigned ip addresses and domain names
ICANN Internet Corporation for Assigned Names and Numbers
A. File manager: hosts
Download the file, covering the / etc / hosts in the content (which has regular tasks set)
B. Set up domain name server: DNS
Reducing the complexity of the difficulty of the operation of the client
Increased the difficulty of maintaining the server side
C. Distributed the DNS :
Benefits: to reduce the pressure of a single server
Cons: too long; management trouble
Solution: Each level server management only direct subordinates, allow duplicate names
Domain Management
The domain classification:
Top Level Domains: COM CN
Two domain names: of the siNA itxdl
Three domain names: the WWW Blog
Operating mode:
( 1) the client first look for a local hosts file to see if there is returned, otherwise the next step
( 2) client to view the local cache, the cache whether there is purpose of this section, if there is a direct return, no longer making the request out, otherwise the next step forwards.
( 3) The local DNS server forwards the request.
( 4) Check whether the local domain name resolution, it is resolved locally returned, otherwise the next step.
( 5) The local DNS server first looks in the cache, it is returned, if any, to the next step.
( 6) to initiate DNS requests, the root domain returns a list of org domains to address global 13 root domain servers.
( 7) using one org domain IP address, DNS request to initiate, org kernel domain server domain returns a list of addresses.
( 8) using one kernel domain IP address, DNS request is initiated, kernel domain www.kernel.org return the IP address of the host, after a local DNS service received, returned to the client.
Recursive query: pressure on the server side
Iterative query: pressure on the client
software:
bind
service:
named
port:
UDP 53 data communication (DNS)
Data synchronization TCP 53 (master-slave synchronization)
Profiles:
/etc/named.conf The main configuration file server operating parameters
/etc/named.rfc1912.zones zone file server parses zone configuration
/var/named/xx.xx data file host name and the corresponding relationship between the IP address
Installation and deployment
[root@localhost ~]# yum -y install bind
[root@localhost ~]# vi /etc/named.conf
{Options
the listen-Port 53 is ON {192.168.1.211;}; # which port the server is listening (which port the client accesses a server over)
the listen-ON-V6 {Port 53 is ::. 1;};
Directory "/ var / the named "; # data directory.
File-the dump "/var/named/data/cache_dump.db";
statistics-File "/var/named/data/named_stats.txt";
memstatistics-File "/var/named/data/named_mem_stats.txt"; # Data file.
allow-query {any;}; # which allows clients to access.
recursion yes;
Configuration zone file ( /etc/named.rfc1912.zones)
[root@localhost ~]# cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.bak
[root@localhost ~]# vi /etc/named.rfc1912.zones
zone "ljj.com" IN {# specify the DNS domain name to be added.
type master; # indicates the increase is the primary DNS domain
file "ljj.localhost" # Set the file name forward for regional resolution.
allow-update {none;}; # Set DNS allow dynamic updates.
};
Zone "1.168.192.in-addr.arpa" {# specified in the IN region of the reverse lookup zone.
type master; # indicates the reverse lookup zone as the main area.
file "named.empty"; # Set the region to achieve the reverse lookup file name.
allow-update {none;}; # Set DNS allow dynamic updates.
};
Configuration data file / var / named /
[root@localhost ~]# cd /var/named/
[root@localhost named]# cp -p named.localhost ljj.localhost
[root@localhost named]# cp -p named.loopback ljj.empty
[root@localhost named]# vi ljj.localhost
[root@localhost named]# vi ljj.localhost
The TTL 1D $
. Ljj.com the SOA rname.invalid the IN @ (.
(Representing the current DNS domain) 0; serial # SEQ ID
1D; refresh # update time.
IH; # retry the retry time.
1W; # The expire time expires.
3H); minimum # cache time.
Dns.ljj.com NS.
Dns A 192.168.1.211
the WWW A 192.168.1.220
[root@localhost named]# vi ljj.empty
$TTL 1D
@ IN SOA ljj.com. rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS dns.ljj.com.
211 PTR dns.ljj.com.
220 PTR www.ljj.com.
[root @ localhost named] # service named restart
stop named: [OK]
to start named: [OK]
test
[root@localhost ~]# nslookup
> www.ljj.com
Server: 192.168.1.211
Address: 192.168.1.211#53
Name: www.ljj.com
Address: 192.168.1.220
> dns.ljj.com
Server: 192.168.1.211
Address: 192.168.1.211#53
Name: dns.ljj.com
Address: 192.168.1.211
From DNS server
[root@localhost ~]# yum -y install bind
[root@localhost ~]# vi /etc/named.conf
options {
listen-on port 53 { 192.168.1.220; };
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";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query { any; };