DNS service (b)
1, special DNS
1. What is DNS load balancing
DNS load balancing is a technique used to help a request for allocation of a domain on a different machine, eliminating the need to use a single machine to carry the entire load. This approach helps to improve the site and (or) the performance of Web applications, because the traffic load can be shared on a large number of servers, rather than borne by a single machine.
2. How does load-balancing work
A domain name corresponding to a machine DNS IP route is the simplest version, however, many companies use a single domain name at a plurality of IP addresses, thereby allowing the server has the ability to simultaneously process multiple requests.
Most clients only use the first IP address received represents a Domain Name, DNS load balancing advantage of this, the load distribution on all available machines. DNS can each time it receives a new request, sending the list of IP addresses of domain names available in a different order.
A so-called rotation mode is changed in sequence list of IP addresses - to use the client together with the first IP address as a domain name in the list - allowing different clients sent to a different server to handle their requests. Thus, the load request is effectively assigned to a plurality of server machines, rather than relying on a machine to handle all incoming requests.
Here is the deal with load balancing operating principle use DNS works:
For example:
www IN A 172.18.9.4
www IN A 172.18.9.5
www IN A 172.18.9.6
3. Direct DNS
DNS name resolution directly to the corresponding IP server.
wg.com. IN A 172.18.9.7
4. Pan-domain name resolution
The so-called "pan-domain name resolution" means: the use of the wildcard * (asterisk) to do the secondary domain name in order to achieve all of the secondary domain name points to the same IP address.
For example:
* IN A 10.0.0.21
Pan-use analytic **
1 domain name support allows unlimited subdomains (which is the largest pan-domain name resolution purposes).
2. To prevent user errors caused by input problem sites can not be accessed.
3. You can let users directly enter the URL of the landing sites of input compact URL to access the site
*.baidu.com
mail.baidu.com
www.baidu.com
oa.baidu.com
2. Reverse zone resource records
1.PTR record - reverse lookup
Defining area in the main configuration file
vim /etc/named.conf add the following content. Usually reverse lookup zone name, prescriptive rules to write anti-stitching ".in-addr.arpa" for the network address, as follows
zone "0.0.10.in-addr.arpa" IN {
type master;
file "10.0.0.zone";
};
Defined areas parsing library file
In the / var / named / directory, create 10.0.0.zone, parsing library file
/var/named/10.0.0.zone
add the following
[root@ c6m01 named]# cat 0.0.10.zone
$TTL 86400
$ORIGIN 0.0.10.in-addr.arpa.
@ IN SOA www.bw.com. admin.bw.com. (
2017011301
1H
5M
7D
1D
)
IN NS www.bw.com.
22 IN PTR www.bw.com.
Check grammar restart bind service
[root@ c6m01 ~]# named-checkconf -z
zone bw.com/IN: loaded serial 0
zone 0.0.10.in-addr.arpa/IN: loaded serial 2017011301
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
zone 1.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: loaded serial
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0
[root@ c6m01 ~]# echo $?
0
[root@ c6m01 ~]# /etc/init.d/named restart
Test reverse lookup
[root@ c6m01 ~]# nslookup 10.0.0.22
Server: 10.0.0.21
Address: 10.0.0.21#53
22.0.0.10.in-addr.arpa name = www.bw.com.