The IP address of the host can be mapped when the host name is Ping, and vice versa. Configure and specify that the DNS server can quickly deploy the cluster without requiring each host to modify the hosts file to resolve the IP and host names. In Linux, DNS is implemented with BIND.
Environment:
Machine IP machine name use
10.190.60.5 hadoop01.ftgov--DNS host
10.190.60.6 hadoop02.ftgov--DNS client
10.190.60.7 hadoop03.ftgov--DNS client
Steps briefly
To install the bind command:
Yum-y Install bind bind-utils bind-chroot
To modify the/etc/named.conf access permission command:
Modify the/etc/named.rfc1912.zones file and add the forward and reverse configuration commands:
Vim/etc/named.rfc1912.zones
Analytical:
Zone "Ftgov" in { //When input is similar to "ftgov" suffix such as: hadoop01.ftgov is parsing
type master; This is the DNS host
file "named.ftgov.com"; The parsing file will read the domain name of the named.ftgov.com file in the/var/named directory and the IP mapping configuration (file generated later)
allow-update {none;};
Zone "60.190.10.in-addr.arpa" in { //when the input is similar to "10.190.60.xxx" reverse parsing, note the address order
type master;
File "Named.10.190.60.zone"; The anti-solution file is located in the configuration of the Named.10.190.60.zone in the/var/named directory (later generated by the file)
allow-update {none;};
Generate the positive and reverse solution files that need to be used for the above configuration
- Open Directory Cd/var/named
- Generate File Named.ftgov.com
Configure named.ftgov.com
Generate File Named.10.190.60.zone
Configuration
Configuring additional DNS Clients
1. First use ifconfig to see the current client is using which network card like my machine: with the ETH1 network card
2. Modify the document
Vim/etc/sysconfig/network-scripts/ifcfg-eth1 //specifically modify the name of the network card you are currently using
The last line plus a row of DNS host IP
3. Restart Client Network Services
Command:
4. Other clients the same operation
Start the DNS server
Start command:
To see if the service is normal: Tail-n 30/var/log/messages |grep named
Testing the DNS Service
Positive solution:
Inverse solution:
Done.
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.