【发布时间】:2016-12-27 07:19:27
【问题描述】:
我正在尝试创建一个家庭自动化系统,该系统可以在我工作时在白天监视我的狗。我对这个项目的目标是了解一些关于 DNS、文件服务和 RaspberryPi 的知识。
我的硬件设置是这样的:
- 1 RaspberryPi(已启用摄像头,并计划将其用作家庭路由器后面的 Web 服务器)。
- 1 个数字海洋迷你实例(带有通过 BIND 提供的 DNS 的 ubuntu12.04)。
- 1 macbook(现在用这个测试 DNS,但以后会最常使用 iPhone)。
我想使用 bubby.com 作为域名。这在我从我的数字海洋服务器查询时有效。但是,如果我从我的笔记本电脑上尝试,我会得到一个不同的 ip。
来自数字海洋实例的测试:
- dns 设置(/etc/resolv.conf 的内容) 名称服务器 x.x.x.x 名称服务器 8.8.8.8 域名服务器 8.8.4.4
-
bubby.com 的 nslookup
nslookup bubby.comServer: x.x.x.x Address: x.x.x.x#53 Name: bubby.com Address: y.y.y.y(据我所知,1 和 2 是正确的)
macbook 测试
来自 wifi 的 DNS 设置(从网络首选项中检索): 名称服务器 x.x.x.x, 8.8.8.8
-
bubby.com 的 nslookup
nslookup bubby.comServer: x.x.x.x Address: x.x.x.x#53 Non-authoritative answer: Name: bubby.com Address: 216.21.239.197
有人可以帮我解释为什么我从显示不同地址的同一个 dns 服务器得到不同的结果,即使服务器/地址对于 dns 服务器是正确的?
更新 1:重新运行 nslookup 测试
date && nslookup bubby.com
Sat Aug 20 05:57:01 PDT 2016
Server: x.x.x.x
Address: x.x.x.x#53
Non-authoritative answer:
Name: bubby.com
Address: 216.21.239.197
从笔记本电脑上挖掘 bubby.com
date && dig bubby.com @192.241.227.149
Sat Aug 20 06:06:27 PDT 2016
; <<>> DiG 9.8.3-P1 <<>> bubby.com @x.x.x.x
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18813
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;bubby.com. IN A
;; ANSWER SECTION:
bubby.com. 3600 IN A 216.21.239.197
;; Query time: 132 msec
;; SERVER: x.x.x.x#53(x.x.x.x)
;; WHEN: Sat Aug 20 06:06:27 2016
;; MSG SIZE rcvd: 43
使用 dns 从数字海洋服务器挖掘 hubby.com
date && dig bubby.com @x.x.x.x
Sat Aug 20 13:12:36 UTC 2016
; <<>> DiG 9.8.1-P1 <<>> bubby.com @x.x.x.x
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38404
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;bubby.com. IN A
;; ANSWER SECTION:
bubby.com. 604800 IN A y.y.y.y
;; AUTHORITY SECTION:
bubby.com. 604800 IN NS ns.bubby.com.
;; ADDITIONAL SECTION:
ns.bubby.com. 604800 IN A y.y.y.y
;; Query time: 2 msec
;; SERVER: x.x.x.x#53(x.x.x.x)
;; WHEN: Sat Aug 20 13:12:36 2016
;; MSG SIZE rcvd: 76
更新 2:在指定另一个 DNS 服务器时从笔记本电脑进行 DNS 查找
date && nslookup ip.smartydns.com 87.117.205.40
Sat Aug 20 09:12:09 PDT 2016
Server: 87.117.205.40
Address: 87.117.205.40#53
Non-authoritative answer:
Name: ip.smartydns.com
Address: 82.196.5.38
【问题讨论】:
-
你能在你的 macbook 上重复测试吗(nslookup 输出看起来像是在 192.241.227.149 上配置 bubby.com 区域之前的),也试试
dig bubby.com @192.241.227.149 -
请再做一个测试:
nslookup ip.smartydns.com 87.117.205.40的输出(在您的笔记本电脑上)是什么? -
您是否考虑过编辑您的
/etc/hosts文件? -
@BasileStarynkevitch - 是的,我考虑过共享主机文件,但将来我打算扩展我的家庭网络,所以我希望 DNS 能够正常工作。
-
@DusanBajic 用最近的测试更新了主帖
标签: dns