解決 GFW 的 DNS 汙染 - 大陸工作
By Daniel
at 2014-07-06T18:48
at 2014-07-06T18:48
Table of Contents
這篇比較偏技術,如果你跟我一樣使用 Macbook/Linux
可以自己動手免除 GFW DNS 汙染
http://www.v2ex.com/t/121025
使用 Windows 的人可以使用 ChinaDNS http://www.v2ex.com/t/118913
已經有人將 Python source code 包成 exe 可以直接使用
家庭式的解法就是找臺少用的電腦當主機跑 DNSmasq 或 ChinaDNS
然後將 router 的 DNS query 指向這臺主機便解決
或者你可以將這個 patched 過的 DNSmasq corss compile 到 openwrt 上執行也行
理論上可以在小米路由上跑...
使用這種方式有以下優點
1. 連線中國境內的網站時 CDN 是中國區而不是其他亂七八糟不知道那個國家的 CDN
導致速度莫名其妙的慢。例如在中國連臺灣的 Apple App store
2. 連線到被牆的網站時拿得到正確的 IP
3. 加速解析到正確域名的時間
4. 免除使用 smart host,也省去手動更新的缺點
5. 應該可以免除一些奇奇怪怪的靈異現象
這個是比較偏技術且 dark art,所以恕不提供指導
README.md 已經都寫的非常清楚了
使用 DNSMasq 的人如果看到以下類似的訊息表示你成功了
dnsmasq: reply youtube-ui-china.l.google.com is 46.82.174.68
dnsmasq: reply p04-streams.icloud.com.akadns.net is NODATA-IPv6
dnsmasq: reply p04-streams.icloud.com.akadns.net is 17.158.28.21
dnsmasq: query[AAAA] api.twitter.com from 127.0.0.1
dnsmasq: forwarded api.twitter.com to 114.114.114.114
dnsmasq: query[AAAA] 1.courier-sandbox-push-apple.com.akadns.net from 127.0.0.1
dnsmasq: cached 1.courier-sandbox-push-apple.com.akadns.net is NODATA-IPv6
dnsmasq: query[A] e3191.dscc.akamaiedge.net from 127.0.0.1
dnsmasq: cached e3191.dscc.akamaiedge.net is 23.11.125.15
dnsmasq: query[AAAA] us-courier.push-apple.com.akadns.net from 127.0.0.1
dnsmasq: cached us-courier.push-apple.com.akadns.net is NODATA-IPv6
dnsmasq: query[AAAA] youtube-ui-china.l.google.com from 127.0.0.1
dnsmasq: forwarded youtube-ui-china.l.google.com to 114.114.114.114
dnsmasq: reply api.twitter.com is NODATA-IPv6
dnsmasq: reply youtube-ui-china.l.google.com is 2404:6800:4005:804::1009
dnsmasq: query[A] ptt.cc from 127.0.0.1
dnsmasq: forwarded ptt.cc to 114.114.114.114
dnsmasq: query[AAAA] ptt.cc from 127.0.0.1
dnsmasq: forwarded ptt.cc to 114.114.114.114
dnsmasq: reply ptt.cc is 140.112.172.2
dnsmasq: reply ptt.cc is 140.112.172.1
dnsmasq: reply ptt.cc is 140.112.172.11
dnsmasq: reply ptt.cc is 140.112.172.3
dnsmasq: reply ptt.cc is 140.112.172.4
dnsmasq: reply ptt.cc is 140.112.172.5
dnsmasq: reply ptt.cc is NODATA-IPv6
dnsmasq: query[AAAA] p04-keyvalueservice.icloud.com.akadns.net from 127.0.0.1
dnsmasq: forwarded p04-keyvalueservice.icloud.com.akadns.net to 114.114.114.114
dnsmasq: query[A] p04-keyvalueservice.icloud.com.akadns.net from 127.0.0.1
dnsmasq: forwarded p04-keyvalueservice.icloud.com.akadns.net to 114.114.114.114
dnsmasq: reply p04-keyvalueservice.icloud.com.akadns.net is NODATA-IPv6
dnsmasq: reply p04-keyvalueservice.icloud.com.akadns.net is 17.158.28.25
dnsmasq: reply p04-keyvalueservice.icloud.com.akadns.net is 17.158.28.47
reference
1. https://github.com/styx-hy/dnsmasq-chinadns
2. https://www.v2ex.com/t/118885#reply7
3. http://gfwrev.blogspot.jp/2009/11/gfwdns.html
--
可以自己動手免除 GFW DNS 汙染
http://www.v2ex.com/t/121025
使用 Windows 的人可以使用 ChinaDNS http://www.v2ex.com/t/118913
已經有人將 Python source code 包成 exe 可以直接使用
家庭式的解法就是找臺少用的電腦當主機跑 DNSmasq 或 ChinaDNS
然後將 router 的 DNS query 指向這臺主機便解決
或者你可以將這個 patched 過的 DNSmasq corss compile 到 openwrt 上執行也行
理論上可以在小米路由上跑...
使用這種方式有以下優點
1. 連線中國境內的網站時 CDN 是中國區而不是其他亂七八糟不知道那個國家的 CDN
導致速度莫名其妙的慢。例如在中國連臺灣的 Apple App store
2. 連線到被牆的網站時拿得到正確的 IP
3. 加速解析到正確域名的時間
4. 免除使用 smart host,也省去手動更新的缺點
5. 應該可以免除一些奇奇怪怪的靈異現象
這個是比較偏技術且 dark art,所以恕不提供指導
README.md 已經都寫的非常清楚了
使用 DNSMasq 的人如果看到以下類似的訊息表示你成功了
dnsmasq: reply youtube-ui-china.l.google.com is 46.82.174.68
dnsmasq: reply p04-streams.icloud.com.akadns.net is NODATA-IPv6
dnsmasq: reply p04-streams.icloud.com.akadns.net is 17.158.28.21
dnsmasq: query[AAAA] api.twitter.com from 127.0.0.1
dnsmasq: forwarded api.twitter.com to 114.114.114.114
dnsmasq: query[AAAA] 1.courier-sandbox-push-apple.com.akadns.net from 127.0.0.1
dnsmasq: cached 1.courier-sandbox-push-apple.com.akadns.net is NODATA-IPv6
dnsmasq: query[A] e3191.dscc.akamaiedge.net from 127.0.0.1
dnsmasq: cached e3191.dscc.akamaiedge.net is 23.11.125.15
dnsmasq: query[AAAA] us-courier.push-apple.com.akadns.net from 127.0.0.1
dnsmasq: cached us-courier.push-apple.com.akadns.net is NODATA-IPv6
dnsmasq: query[AAAA] youtube-ui-china.l.google.com from 127.0.0.1
dnsmasq: forwarded youtube-ui-china.l.google.com to 114.114.114.114
dnsmasq: reply api.twitter.com is NODATA-IPv6
dnsmasq: reply youtube-ui-china.l.google.com is 2404:6800:4005:804::1009
dnsmasq: query[A] ptt.cc from 127.0.0.1
dnsmasq: forwarded ptt.cc to 114.114.114.114
dnsmasq: query[AAAA] ptt.cc from 127.0.0.1
dnsmasq: forwarded ptt.cc to 114.114.114.114
dnsmasq: reply ptt.cc is 140.112.172.2
dnsmasq: reply ptt.cc is 140.112.172.1
dnsmasq: reply ptt.cc is 140.112.172.11
dnsmasq: reply ptt.cc is 140.112.172.3
dnsmasq: reply ptt.cc is 140.112.172.4
dnsmasq: reply ptt.cc is 140.112.172.5
dnsmasq: reply ptt.cc is NODATA-IPv6
dnsmasq: query[AAAA] p04-keyvalueservice.icloud.com.akadns.net from 127.0.0.1
dnsmasq: forwarded p04-keyvalueservice.icloud.com.akadns.net to 114.114.114.114
dnsmasq: query[A] p04-keyvalueservice.icloud.com.akadns.net from 127.0.0.1
dnsmasq: forwarded p04-keyvalueservice.icloud.com.akadns.net to 114.114.114.114
dnsmasq: reply p04-keyvalueservice.icloud.com.akadns.net is NODATA-IPv6
dnsmasq: reply p04-keyvalueservice.icloud.com.akadns.net is 17.158.28.25
dnsmasq: reply p04-keyvalueservice.icloud.com.akadns.net is 17.158.28.47
reference
1. https://github.com/styx-hy/dnsmasq-chinadns
2. https://www.v2ex.com/t/118885#reply7
3. http://gfwrev.blogspot.jp/2009/11/gfwdns.html
--
Tags:
大陸工作
All Comments
By Megan
at 2014-07-07T08:06
at 2014-07-07T08:06
By Andrew
at 2014-07-11T08:14
at 2014-07-11T08:14
By Franklin
at 2014-07-14T11:10
at 2014-07-14T11:10
By Lucy
at 2014-07-15T13:11
at 2014-07-15T13:11
By Christine
at 2014-07-20T06:12
at 2014-07-20T06:12
By Harry
at 2014-07-24T15:50
at 2014-07-24T15:50
By Rosalind
at 2014-07-28T09:55
at 2014-07-28T09:55
By Isla
at 2014-08-01T10:20
at 2014-08-01T10:20
By Odelette
at 2014-08-05T18:13
at 2014-08-05T18:13
Related Posts
幫忙測試v批恩
By Jack
at 2014-07-06T01:29
at 2014-07-06T01:29
深圳龍華富士康
By Skylar Davis
at 2014-07-06T00:29
at 2014-07-06T00:29
杭州新人
By Zanna
at 2014-07-05T21:23
at 2014-07-05T21:23
上海楊浦新手上陸
By Hardy
at 2014-07-05T17:21
at 2014-07-05T17:21
重慶新人
By Ina
at 2014-07-05T01:26
at 2014-07-05T01:26