Chinaunix

标题: dig命令的一个菜鸟问题 [打印本页]

作者: justlucifer    时间: 2013-02-22 17:03
标题: dig命令的一个菜鸟问题
我用的是centos6.3,在学习dig命令,
[root@localhost etc]# dig @server baidu.com
dig: couldn't get address for 'server': not found
请问,出现这种情况的原因是什么呢?

作者: Shell_HAT    时间: 2013-02-22 17:16
       server
           is the name or IP address of the name server to query. This can be an IPv4 address in dotted-decimal notation or an IPv6 address in colon-delimited notation. When the
           supplied server argument is a hostname, dig resolves that name before querying that name server. If no server argument is provided, dig consults /etc/resolv.conf and
           queries the name servers listed there. The reply from the name server that responds is displayed.

这里的server是你指定的name server,一般不需要的。直接:
  1. dig www.baidu.com
复制代码

作者: xingchuang_cu    时间: 2013-02-22 17:27
@server是你指定的dnsserver的ip,如:dig @8.8.8.8 www.baidu.com
作者: zongg    时间: 2013-02-22 17:33
直接用dig 域名   就可以了。
作者: justlucifer    时间: 2013-02-25 11:34
回复 3# xingchuang_cu


   你说的对,谢谢你啦




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2