[Linux] install DNS domain name resolution service, linuxdns domain name resolution
- In Linux, DNS is implemented using bind.
- Hardware and Configuration:
Machine IP Address |
Machine name |
Purpose |
10.190.60.5 |
Hadoop01.ftgov |
DNS host |
10.190.60.6
|
Hadoop02.ftgov
|
DNS Client |
10.190.60.7
|
Hadoop03.ftgov
|
DNS Client |
Procedure
Command: yum-y install bind-utils bind-chroot
- Modify/etc/named. conf access permission
Command: vim/etc/named. conf
- Modify the/etc/named. rfc1912.zones file and add the forward and reverse resolution configurations.
Command: vim/etc/named. rfc1912.zones
Resolution: zone "ftgov" IN {// type master is being resolved when the input is similar to "ftgov" suffix such as hadoop01.ftgov; // This is the dns host file "named.ftgov.com "; // The resolution file will read the domain name and IP ing configuration of the named.ftgov.com file in the/var/named directory (generated later) allow-update {none ;};}; zone "60.190.10.in-addr. arpa "IN {// anti-resolution when the input is similar to" 10.190.60.xxx ". Pay attention to the Address Sequence type master; file" named.10.190.60.zone "; // The Reverse file is located in the configuration of named.10.190.60.zone in the/var/named directory (generated later) allow-update {none ;};};
- Generate the forward and reverse file required for the above Configuration
- Open the directory cd/var/named
- Generate file named.ftgov.com
-
- Configure named.ftgov.com
- Generate file named.10.190.60.zone
- Configuration
- Configure other DNS clients
1. First Use ifconfig to check which Nic is used by the current client, such as my host: eth1 Nic
2. Modify the file vim/etc/sysconfig/network-scripts/ifcfg-eth1 // specifically change to the last line of your current Nic name plus a line of DNS host IP 3. Restart the client network SERVICE
Command: service network restart 4. other clients perform the same operation
Run the command: service named start to check whether the service is normal: tail-n 30/var/log/messages | grep named
Positive result: reverse result: