在 Linux 下執行 nslookup 指令都會出現下列訊息:
Note: nslookup is deprecated and may be removed from future releases. Consider using the `dig' or `host' programs instead. Run nslookup with the `-sil[ent]' option to prevent this message from appearing.
告訴你使用 dig 或 host 指令來取代 nslookup。
以下是 dig 及 host 的查詢語法(順便附上 nslookup 的語法):
- dig:
dig @[NameServer] [網域名稱] [Type]
- host:
host -t [Type] [網域名稱] [NameServer]
- nslookup:
nslookup -type=[Type] [網域名稱] [NameServer]
其中 Type 的參數有
- any
- a: 查 IP Address
- mx: 查郵件伺服器
- ns: 查名稱伺服器
- cname: 查別名
- ptr: 由 IP Address 反查網域名稱
- hinfo: 查伺服器的系統資訊
通告: Heartshare » nslookup, dig, host 指令的查詢語法