Detailed steps for RedHatCentOS DNS server reverse resolution

Source: Internet
Author: User
Tags nameserver
The following is reverse resolution based on RedHat5 or CentOS system (IP192.168.1.2 domain name is www.linuxidc.com). to ensure successful construction, please do not miss any steps. The following is a detailed step-by-step command can also ensure success! If you have completed a forward resolution (for details, refer to the previous article) and passed the test, the class will go through reverse resolution based on RedHat 5 or CentOS (IP192.168.1.2 domain name is www.linuxidc.com) to ensure the construction is successful, do not miss any step. The following is a detailed step-by-step command execution can also ensure the success! If you have completed a positive analysis (for details, refer to the previous article) and passed the test, the class starts directly from step 3.

1. install related software packages: to ensure smooth operation, follow these steps to delete and reinstall all software packages.

[Root @ server ~] # Rpm-qa | grep bind // view bind related software packages


[Root @ server ~] # Rpm-e 'rpm-qa | grep bind' -- nodeps // delete related software packages
[Root @ server ~] # Mount/dev/cdrom/media // mount the system disk to/media/
[Root @ server media] # cd/media/Server // enter the/media/Server/Directory (if it is a CentOS system, enter the/media/CentOS/directory)
[Root @ server Server] # rpm-vih bind-* // reinstall the software package
[Root @ server Server] # rpm-vih caching-nameserver-9.3.3-7.el5.i386.rpm // The package name in CentOS is different so you need to use Tab to complete
[Root @ server Server] # service named start // restart the named service


2. modify the master configuration file
[Root @ server Server] # cd/var/named/chroot/etc // enter the/var/named/chroot/etc/Directory
[Root @ server etc] # vim named. caching-nameserver.conf // modify the master configuration file
----------------------------------------------------------------------
Options {
Listen-on port 53 {any ;}; // modify it to any
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 ";
Query-source port 53;
Query-source-v6 port 53;
Allow-query {any ;}; // modify it to any
};
Logging {
Channel default_debug {
File "data/named. run ";
Severity dynamic;
};
};
View localhost_resolver {
Match-clients {any ;}; // modify it to any
Match-destinations {any ;}; // modify it to any
Recursion yes;
Include "/etc/named. rfc1912.zones ";
};
----------------------------------------------------------------------
######################################## ########################
If forward parsing has been completed, we can start from here.
3. modify the extension file of the host configuration file
[Root @ localhost ~] # Cd/var/named/chroot/etc // enter the/var/named/chroot/etc/Directory
[Root @ server etc] # vim named. rfc1912.zones // modify the extension of the host configuration file. add the following in the last line:
----------------------------------------------------------------------
Zone "1.168.192.in-addr. arpa" IN {// unwrite the first three IP addresses of your host
Type master;
File "192.168.1.rev ";
};
---------------------------------------------------------------------

4. create a domain configuration file for 192.168.1.rev
[Root @ server etc] # cd/var/named/chroot/var/named // enter the/var/named/chroot/var/named/Directory
[Root @ localhost named] # cp named. local 192.168.1.rev // Copy the domain configuration file 192.168.1.rev
[Root @ localhost named] # vim 192.168.1.rev
--------------------------------------------------------------------
$ TTL 86400
@ In soa localhost. root. localhost .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns localhost.
2 in ptr www.linuxidc.com. // modify the last line to (my IP address is 192.168.1.2 and the domain name is www.linuxidc.com)

--------------------------------------------------------------------
[Root @ server named] # bind-chroot-admin-s // automatically sets the group and permissions (/usr/bin/find may be prompted in CentOS: /var/log/named. log: The file or directory does not exist)
[Root @ server named] # service named restart // restart the named service

5. test and verification
In order to verify the success, it is best to modify the local DNS and change the server to its own IP address.
Vi/etc/resolv. conf
Nameserver 192.168.1.2
: Wq // save and exit
[Root @ localhost named] # host 192.168.1.2 // verify that the resolution is successful on the local machine

192.168.1.2.in-addr. arpa domain name pointer www.linuxidc.com.

C: Documents and SettingsAdministrator> nslookup // verify that the resolution is successful at the remote end.
* ** Cant find server name for address 219.244.93.2: Non-existent domain
* ** Default servers are not available
Default Server: UnKnown
Address: 219.244.93.2 // Originally, my DNS is 219.244.93.2

> Server 192.168.1.2 // modify the DNS host
Default Server: [192.168.1.2]
Address: 192.168.1.2

> Www.linuxidc.com
Server: [192.168.1.2]
Address: 192.168.1.2

Name: www.linuxidc.com
Address: 192.168.1.2
 
Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.