CentOS下搭建DNS服务器( 三 )

  • > 172-16-1-51.realhostip.com
  • Server: 172.16.1.4
  • Address: 172.16.1.4#53
  •  
  • Name: 172-16-1-51.realhostip.com
  • Address: 172.16.1.51
  • >
  • 从结果可以看到,我们配置的两个域名都能成功解析,并且DNS服务器就是我们配置的那个服务器 。
     
    4. 反向解析,使用nslookup命令
    #nslookup
    [html] view plaincopy
    1. >
    2. > 172.16.1.51
    3. Server: 172.16.1.4
    4. Address: 172.16.1.4#53
    5.  
    6. 51.1.16.172.in-addr.arpa name = 172-16-1-51.realhostip.com.
    7. >
    8. >
    9. > 172.16.1.50
    10. Server: 172.16.1.4
    11. Address: 172.16.1.4#53
    12.  
    13. 50.1.16.172.in-addr.arpa name = 172-16-1-50.realhostip.com.
    14. >
    15. >
    从结果来看,可以正确解析我们的IP地址,并且DNS服务器就是我们配置的那个服务器 。
     
    5. 查看realhostip.com这个域名是哪个DNS服务器管理的,使用dig命令
    # dig -t ns realhostip.com
    [html] view plaincopy
    1. ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> -t ns realhostip.com
    2. ;; global options: +cmd
    3. ;; Got answer:
    4. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37964
    5. ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 2
    6.  
    7. ;; QUESTION SECTION:
    8. ;realhostip.com. IN NS
    9.  
    10. ;; ANSWER SECTION:
    11. realhostip.com. 86400 IN NS realhostip.com.
    12.  
    13. ;; ADDITIONAL SECTION:
    14. realhostip.com. 86400 IN A 172.16.1.4
    15. realhostip.com. 86400 IN AAAA ::1
    16.  
    17. ;; Query time: 1 msec
    18. ;; SERVER: 172.16.1.4#53(172.16.1.4)
    19. ;; WHEN: Wed Oct 23 14:15:22 2013
    20. ;; MSG SIZE rcvd: 90

     
    6. 使用dig命令进行正向解析
    # dig 172-16-1-50.realhostip.com
    [html] view plaincopy
    1. ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> 172-16-1-50.realhostip.com
    2. ;; global options: +cmd
    3. ;; Got answer:
    4. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21109
    5. ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
    6.  
    7. ;; QUESTION SECTION:
    8. ;172-16-1-50.realhostip.com. IN A
    9.  
    10. ;; ANSWER SECTION:
    11. 172-16-1-50.realhostip.com. 86400 IN A 172.16.1.50
    12.  
    13. ;; AUTHORITY SECTION:
    14. realhostip.com. 86400 IN NS realhostip.com.
    15.  
    16. ;; ADDITIONAL SECTION:
    17. realhostip.com. 86400 IN A 172.16.1.4
    18. realhostip.com. 86400 IN AAAA ::1
    19.  
    20. ;; Query time: 1 msec
    21. ;; SERVER: 172.16.1.4#53(172.16.1.4)
    22. ;; WHEN: Wed Oct 23 14:17:57 2013
    23. ;; MSG SIZE rcvd: 118
    注意:
    windows客户端上只有nslookup工具 。




    推荐阅读