nslookup 在非交互模式下查找 SRV 记录(或任何非 A 记录)

DrS*_*ker 18 domain-name-system command-line-interface nslookup

无论如何要运行 nslookup(Centos 5 或 Windows),以便它可以查找 A 以外的记录类型,而无需进入交互模式并使用set type=? 例如,我想要如下命令:

nslookup --type=SRV _ldap._tcp.mydomain.com
Run Code Online (Sandbox Code Playgroud)

Zyp*_*her 27

你实际上几乎拥有它。在两个窗口(至少我这里有我的 Win7 盒子)和 Ubuntu 上你都会做nslookup -type=SRV _ldap._tcp.mydomain.com(注意单破折号)

  • `nslookup -q=MX serverfault.com` 也可以工作(除了用 SRV 替换 MX 等等) (3认同)

小智 6

这对我有用

nslookup -q=SRV _ldap._tcp.mydomain.com 
Run Code Online (Sandbox Code Playgroud)

所以 nslookup -q=SRV _sip._tls.tan-ha.com

Server:  myhost.local  
Address:  1.2.3.4 (my ip)

Non-authoritative answer:  
_sip._tls.tan-ha.com    SRV service location:  
          priority       = 100  
          weight         = 1  
          port           = 443  
          svr hostname   = sipdir.myotherdomainorso.com  

sipdir.myotherdomainorso.com  internet address = 110.12.23.34  
sipdir.myotherdomainorso.com  AAAA IPv6 address = 1111:111:ffff:3004::35
Run Code Online (Sandbox Code Playgroud)


Ale*_*lst 4

看来 nslookup 手册页不再正确。

nslookup 没有强大的非交互模式:

      “非交互模式用于仅打印姓名和
       请求的主机或域信息”

相反,使用主机(1):

主机-t SRV example.com