dig查询域名解析

  • 获取根域名的NS服务器地址
dig ns baidu.com
;; ANSWER SECTION:
baidu.com.		3600	IN	NS	dns.baidu.com.
baidu.com.		3600	IN	NS	ns7.baidu.com.
baidu.com.		3600	IN	NS	ns3.baidu.com.
baidu.com.		3600	IN	NS	ns2.baidu.com.
baidu.com.		3600	IN	NS	ns4.baidu.com.
  • 使用根域名的NS服务器获取域名解析的TTL
dig +nocmd +noall +answer @ns1.alibabadns.com op.keruyun.com                                                                              ─╯
op.keruyun.com.		300	IN	CNAME	int.slb.keruyun.com. # 300为TTL

# 或者使用google dns查询
dig +nocmd +noall +answer @8.8.8.8 op.keruyun.com                                                                                         ─╯
op.keruyun.com.		300	IN	CNAME	int.slb.keruyun.com. # ttl 300
int.slb.keruyun.com.	600	IN	A	172.16.45.217 # ttl 600