10 Linux DIG Command Examples for DNS Lookup--reference
|
; <<>> DiG 9.7.3-RedHat-9.7.3-2.el6 <<>> redhat.com NS +noall +answer You can also use option -t to pass the query type (for example: NS) as shown below. $ dig -t NS redhat.com +noall +answer 5. View ALL DNS Records Types Using dig -t ANYTo view all the record types (A,MX,NS,etc.),use ANY as the record type as shown below. $ dig redhat.com ANY +noall +answer (or) Use -t ANY $ dig -t ANY redhat.com +noall +answer 6. View Short Output Using dig +shortTo view just the ip-address of a web site (i.e the A record),use the short form option as shown below. $ dig redhat.com +short 209.132.183.81 You can also specify a record type that you want to view with the +short option. $ dig redhat.com ns +short ns2.redhat.com. ns3.redhat.com. ns1.redhat.com. ns4.redhat.com. 7. DNS Reverse Look-up Using dig -xTo perform a DNS reverse look up using the ip-address using dig -x as shown below For example,if you just have an external ip-address and would like to know the website that belongs to it,do the following. $ dig -x 209.132.183.81 +short www.redhat.com. To view the full details of the DNS reverse look-up,remove the +short option. $ dig -x 209.132.183.81 8. Use a Specific DNS server Using dig @dnsserverBy default dig uses the DNS servers defined in your /etc/resolv.conf file. If you like to use a different DNS server to perform the query,specify it in the command line as @dnsserver. The following example uses ns1.redhat.com as the DNS server to get the answer (instead of using the DNS servers from the /etc/resolv.conf file). $ dig @ns1.redhat.com redhat.com |
- redhat – Kickstart:通过CGI或PHP脚本提供动态
- Ubuntu Unity Remix 20.04非官方风味稳定版本正式
- Ubuntu Touch OTA-12首次发布,为有史以来最大版
- ssh – 可以在Linux(ext3)上减慢日志写入速度吗?
- Ubuntu Studio 20.10抛弃Xfce桌面转向更高级的KD
- linux – 使用systemd服务单元的Restartamp;Rest
- 解决Manjaro Linux无法安装搜狗拼音
- Linux文件操作之文件查询与搜索命令分析
- AMDVLK 2020.Q2.3 发布,新扩展与各种完善
- Find command usage in Linux with excellent ex


