Hello, DNS!

Hello and welcome to DNS! https://powerdns.org/hello-dns/

This series of documents attempts to provide a correct introduction to the Domain Name System as of 2018. The original RFCs remain the authoritative source of normative text, but this document tries to make this venerable protocol more accessible, while maintaining full alignment with all relevant and useful RFCs.

This effort is developed cooperatively on GitHub, the repository can be found https://github.com/ahupowerdns/hello-dns/and help is highly welcome! Feedback can also be sent to bert.hubert@powerdns.com or @PowerDNS_Bert.

Contributors so far include: Michał Kępień, Jan-Piet Mens, Andrew Babichev, Jacob Hoffman-Andrews, Peter van Dijk, Nathan Froyd, Gene McCulley, Charles-Henri Bruyand, jose nazario, Warren Kumari, Patrick Cloke, and Andrew Tunnell-Jones. Thanks!

Although we start from relatively basic principles, the reader is expected to know what IP addresses are, what a (stub) resolver is and what an authoritative server is supposed to do. When in doubt: authoritative servers 'host' DNS data, 'resolvers' look up things over at authoritative servers and clients run 'stub resolvers' to look things up over at resolvers. This document is aimed at developers, but may also be of aid for administrators.

DNS was originally written down in August 1979 in 'IEN 116', part of a parallel series of documents describing the Internet. IEN 116-era DNS is not compatible with today's DNS. In 1983, RFC 882 and 883 were released, describing a version of the DNS very similar but not quite interoperable with the one we have today.

DNS attained its modern form in 1987 when RFC 1034 and 1035 were published. Although much of 1034/1035 remains valid, these standards are not that easy to read because they were written in a very different time. There are 100s of pages of updates that can only be found in later documents.

The main goal of this effort is not to contradict the DNS RFCs but to provide an easier entrypoint into understanding the Domain Name System.

If you will, the goal is to be a mini "TCP/IP Illustrated" of DNS. For more about the philosophy of these documents, and how to contribute, please read meta.md. Your help & insights are highly welcome!

I want to thank Ólafur Guðmundsson and Job Snijders for their input and enthusiasm for improving the state of DNS.

Layout

The content is spread out over several documents:

We start off with a general introduction of DNS basics: what is a resource record, what is an RRSET, what is a zone, what is a zone-cut, how are packets laid out. This part is required reading for anyone ever wanting to query a nameserver or emit a valid response.

We then specialize into what applications can expect when they send questions to a resolver, or what a stub resolver can expect.

The next part is about what an authoritative server is supposed to do. On top of this, we describe in slightly less detail how a resolver could operate. Finally, there is a section on optional elements like EDNS, TSIG, Dynamic Updates and DNSSEC.

RFCs, especially earlier ones, tend to describe servers that perform both authoritative and resolver functions. This turns out to make both code and troubleshooting harder. Therefore, in these documents, the authoritative and caching functions are described separately.

Next up: DNS Basics.

<style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="ext/markdeep.min.js"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>

from https://github.com/ahupowerdns/hello-dns

在mac上,用brew安装v2ray

 


Install v2ray-core

step 1: Add official tap

brew tap v2ray/v2ray

step 2: Install v2ray-core:

brew install v2ray-core

Update v2ray-core

step 1: update tap

brew update

step 2: update v2ray-core

brew upgrade v2ray-core

Uninstall v2ray-core

step 1: uninstall core

brew uninstall v2ray-core

step 2: untap official formula

brew untap v2ray/v2ray

Usage

once you installed, you can run command via v2ray to run v2ray-core.

The defualt config file location is:/usr/local/etc/v2ray/config.json

step 1: edit the default config:

vim /usr/local/etc/v2ray/config.json

step 2: run v2ray-core without starting at login.

brew services run v2ray-core

or run v2ray-core and register it to launch at login via:

brew services start v2ray-core

fromhttps://github.com/v2ray/homebrew-v2ray
-------

To have launchd start v2ray/v2ray/v2ray-core now and restart at login:

  brew services start v2ray/v2ray/v2ray-core

Or, if you don't want/need a background service you can just run:

  v2ray -config=/usr/local/etc/v2ray/config.json

==> Summary

🍺  /usr/local/Cellar/v2ray-core/4.19.1: 7 files, 34MB, built in 9 minutes 46 seconds

美国各大学里的Material Science Engineering系

University Name

University City(State)

Alfred University, Materials Science and Engineering Program

Alfred (NY)

Arizona State University, Materials Science and Engineering Program

Tempe (AZ)

Auburn University, Materials Engineering Program

Auburn University (AL)

Boise State University, Department of Materials Science and Engineering

Boise (ID)

Brown University, Materials Engineering Program

Providence (RI)

California Polytechnic State University - San Louis, Materials Engineering Department

San Luis Obispo (CA)

Carnegie Mellon University, Department of Materials Science and Engineering

Pittsburgh (PA)

Case Western Reserve University, Department of Materials Science and Engineering

Cleveland (OH)

Colorado School of Mines, Department of Metallurgical and Materials Engineering

Golden (CO)

Cornell University, Department of Materials Science and Engineering

Ithaca (NY)

Drexel University, Department of Materials Science and Engineering

Philadelphia (PA)

Georgia Institute of Technology, School of Materials Science and Engineering

Atlanta (GA)

Illinois Institute of Technology, Mechanical, Materials and Aerospace Engineering Department

Chicago (IL)

Iowa State University, Materials Science and Engineering Department

Ames (IA)

Johns Hopkins University, Materials Science and Engineering Department

Baltimore (MD)

Lehigh University, Department of Materials Science and Engineering

Bethlehem (PA)

Massachusetts Institute of Technology, Department of Materials Science and Engineering

Cambridge (MA)

Michigan State University, Department of Chemical Engineering and Materials Science

East Lansing (MI)

Michigan Technological University, Department of Materials Science and Engineering

Houghton (MI)

Montana Tech, Metallurgical and Materials Engineering Program

Butte (MT)

New Mexico Tech, Materials Engineering Department

Socorro (NM)

North Carolina State University, Department of Materials Science and Engineering

Raleigh (NC)

Northwestern University, Department of Materials Science and Engineering

Evanston (IL)

Pennsylvania State University, Department of Materials Science and Engineering

University Park (PA)

Purdue University, School of Materials Engineering

West Lafayette (IN)

Rensselaer Polytechnic Institute, Department of Materials Science and Engineering

Troy (NY)

Rutgers University, Department of Materials Science and Engineering

Piscataway (NJ)

San Jose State University, Department of Biomedical, Chemical and Materials Engineering

San Jose (CA)

The Ohio State University, Department of Materials Science and Engineering

Columbus (OH)

The University of Akron, Department of Polymer Engineering

Akron (OH)

University of Alabama - Birmingham, Materials Science and Engineering Department

Birmingham (AL)

University of Arizona, Department of Materials Science and Engineering

Tucson (AZ)

University of California - Berkeley, Department of Materials Science and Engineering

Berkeley (CA)

University of California - Davis, Department of Chemical Engineering and Materials Science

Davis (CA)

University of California - Irvine, Department of Chemical Engineering and Materials Science

Irvine (CA)

University of California - Los Angeles, Department of Materials Science and Engineering

Los Angeles (CA)

University of Cincinnati, Materials Science Program

Cincinnati (OH)

University of Connecticut, Materials Science and Engineering Program

Storrs (CT)

University of Florida, Department of Materials Science and Engineering

Gainesville (FL)

University of Idaho, Department of Chemical and Materials Engineering

Moscow (ID)

University of Illinois - Urbana-Champaign, Department of Materials Science and Engineering

Urbana (IL)

University of Kentucky, Department of Chemical and Materials Engineering

Lexington (KY)

University of Maryland, Department of Materials Science and Engineering

College Park (MD)

University of Michigan - Ann Arbor, Department of Materials Science and Engineering

Ann Arbor (MI)

University of Minnesota - Twincities, Chemical Engineering and Materials Science Department

Minneapolis (MN)

University of Pennsylvania, Department of Materials Science and Engineering

Philadelphia (PA)

University of Pittsburgh, Department of Mechanical Engineering and Materials Science

Pittsburgh (PA)

University of Tennessee - Knoxville, Materials Science and Engineering Department

Knoxville (TN)

University of Texas at El Paso, Department of Metallurgical and Materials Engineering

El Paso (TX)

University of Utah, Department of Materials Science and Engineering

Salt Lake City (UT)

University of Washington, Department of Materials Science and Engineering

Seattle (WA)

University of Wisconsin - Madison, Department of Materials Science and Engineering

Madison (WI)

University of Wisconsin - Milwaukee, Department of Materials

Milwaukee (WI)

Virginia Tech, Department of Materials Science and Engineering

Blacksburg (VA)

Washington State University, School of Mechanical and Materials Engineering

Pullman (WA)

Winona State University, Composite Materials Engineering Program

Winona (MN)

 

from http://www.univsource.com/materialscience.htm

dnsforwarder(不好用,感觉有bug)

windows下有编译好了的二进制版本,linux下需要自己编译。

项目网址:

https://github.com/holmium/dnsforwarder

wiki:

https://github.com/holmium/dnsforwarder/wiki

DNS 转发器 解决 DNS 污染

DNS 转发器

在本地开启 DNS 端口,以接收 DNS 请求,并以 UDP 或者 TCP 协议转发至指定的 DNS 服务器,然后将结果重新转发至请求端。使用时需要将本机 DNS 服务器设置为 127.0.0.1 或者另外指定的地址。

https://github.com/holmium/dnsforwarder

如果您要部署服务器,建议您使用 5.x 版本:https://github.com/holmium/dnsforwarder/wiki/%E9%A6%96%E6%AC%A1%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95

编译配置选项:https://github.com/holmium/dnsforwarder/wiki/%E7%BC%96%E8%AF%91

最新的二进制文件:https://github.com/holmium/dnsforwarder/tree/5/codeblocks_win/bin

最新的配置文件:https://github.com/holmium/dnsforwarder/blob/5/default.config

2.7 版本下载(2014-03-02):

https://drive.google.com/file/d/0B_yf3JQ0zx6jNGVCZmFfblI5REU/edit?usp=sharing

源码:https://github.com/holmium/dnsforwarder/tree/575e4e4394e3b3c8e4e27d7f6cb3be3ee83d64f4

一些 BUG 修复。

---------------------------------------------

 

DNSFORWARDER解决DNS污染

 

 

在本地开启 DNS的53端口,以接收 DNS 请求,并以 UDP 或者 TCP 协议转发至指定的 DNS 服务器,然后将结果重新转发至请求端。使用时需要将本机的DNS服务器地址设置为 127.0.0.1 。 

 

 

 

 

 

2.7 版本下载(2014-03-02):

一些 BUG 修复。 

 

2.6 Beta 1 版本下载(2014-01-29):

此版本增加了 UDP 并发查询和 UDP 防污染的功能,暂时不需要通过 TCP + GFW List 的方式来避免污染。

此版本的 UDP 防污染有一个BUG,开启 UDP 防污染需要把 UDP 服务器全部设为国外的

 

2.5 Beta 2 版本下载(2013-12-08):

一些小的优化。

 

2.5 Beta 1 版本下载(2013-10-27):

添加了可以对域名指定专门的服务器。

 

2.3.1版本下载(2013-08-26):

减少内存占用和一些小的优化。 

 

2.3版本下载(2013-02-09):

添加IPv6支持,多服务器支持。

 

关于错误信息 An error occured while receiving from xxx.xxx.xxx.xxx : 10054 : An existing connection was forcibly closed by the remote host.

此信息是在接收 DNS 请求时遇到的错误,多半是浏览器等在请求 DNS 后未等到回应就结束连接,如果不是非常频繁的出现,则不必要担心。

 

2.2.4版本(2013-01-23): 

此版本修复上一版本的已知 BUG;添加定时刷新 GFW List 功能。

 

2.2.3版本下载(2013-01-20):

此版本修复上一版本的已知 BUG;添加 GFW List 载入功能;缓存重载功能。

已知 BUG:

`ExcludedDomain' 在未载入 GFW List 时无效。

 

2.2.2版本下载(2013-01-01):

此版本主要添加了排除列表的通配符支持,还有一些BUG修复以及细微的修改

已知 BUG:

IPv6 Hosts 无效

 

2.2.1版本下载(2012-09-16):

使用配置文件,增加 Hosts 载入等功能(支持通配符)。 

 

2.1版本下载(2012-02-24):

此版本增加规则设置,缓存等功能。

 

DNS转发器 UDP to TCP解决DNS污染

DNS 转发器可以将 UDP 形式的 DNS 数据包,以 TCP 形式转发至指定的 DNS 服务器(默认为 Google DNS 8.8.4.4)。

因为听说 TCP 的 DNS 数据包不会被污染或者被伪造,于是做了这么个玩意,省得改系统文件了。

 

 

有一个办法就是将首选 DNS 设为 127.0.0.1,将候选 DNS 设为其他,这样当 DNS 转发器没有启动时也不会影响正常使用。

 

这是直接通过 8.8.8.8 进行的查询(存在 DNS 伪造):

 C:\Users\Admin&gt;nslookup twitter.com 8.8.8.8

服务器:  google-public-dns-a.google.com

Address:  8.8.8.8

 

非权威应答:

名称:    twitter.com

Addresses:  37.61.54.158

          159.106.121.75

 

这是通过转发器进行的查询:

C:\Users\Admin&gt;nslookup twitter.com 127.0.0.1

服务器:  localhost

Address:  127.0.0.1

 

非权威应答:

名称:    twitter.com

Addresses:  199.59.148.82

          199.59.148.10

          199.59.149.198

 

这是使用 http://www.kloth.net/services/nslookup.php 进行的查询:

DNS server handling your query: 8.8.8.8

 DNS server's address: 8.8.8.8#53

 

 Non-authoritative answer:

 Name: twitter.com

 Address: 199.59.148.10

 Name: twitter.com

 Address: 199.59.149.230

 Name: twitter.com

 Address: 199.59.148.82

 

from http://micasmica.blogspot.com/2011/08/dns.html

---------------

DNSForwarder杜绝DNS污染, 直连高速翻墙

 

由于谷歌新一轮被墙,导致GFWList无法更新,DNSForwarder使用困难。

DNSForwarder其实不仅仅是个解决污染的工具了,还附带了一点DNSMasq的意思在里面。研究了一下配置文件,终于想出一个比较合理的方案:

国内域名通过TCP通道走114.114.114.114解析,被墙域名通过UDP通道开启防污染走OpenerDNS来穿墙(感谢评论中Solidium的提示)。 区分方式继续使用GFWList,为了保证GFWList下载成功,在排除域名中增加 *.*google*.* 条目,保证所有google相关域名都走UDP通道。

配置文件我已经改写完成,并更新了最新版的DNSForwarder 5.0.7,打包后分享给大家。

这次不传百度网盘了,怕和谐,就放主机里了,点这儿下载:http://nonofiles.qisns.com/dnsforwarder.7z

下载后不用任何修改,直接运行就可以。需要做到开机自启动请自行添加-d参数的启动项,系统DNS设置首选 127.0.0.1,备用114.114.114.114即可。

亲测谷歌推特脸书U2B在https下全部能打开,基本上是目前不用代理翻墙最好的解决方案了。

 

 

 

貌似最近U2B视频支持https方式直接观看了,这样一来就意味这只要我们能杜绝DNS污染问题,就可以轻松地高速观看U2B上的视频了,任何其他的穿墙方式都无法比拟,因为它们都是代理中转,而通过https直连谷歌服务器就相当于无视墙的存在,不存在性能损耗,实际测试效果也确实令人惊叹,Google的分布式服务器相当给力,在我8M的移动网络下竟然能非常流畅地播放1440P,页面打开速度和视频跳转速度完全不输优酷!

 

 

其实实现原理并不复杂,还是和上次我写的脚本同一个思路:用TCP方式查询DNS来杜绝污染即可。

然而要做好这一点并不简单,因为目前支持TCP方式查询的公用可靠的DNS主要是Google DNS和OpenDNS,但是他们毕竟是国外的DNS,用他们去解析墙外网站没问题,但是解析国内网站很可能分配到国外服务器去导致速度缓慢。不但要能翻,而且要翻得舒服,就不那么容易了。毕竟每次要翻时打开相关软件,看国内网站又要切换回来很麻烦。现在能做到比较好的自如切换方式就是用代理切换软件,效果也还是可以的。VPN那种我看还是算了,毕竟是全局,太不方便。

话说回来,DNS查询如何做到墙外地址用TCP方式查询Google DNS实现突破封锁,而国内网站只使用国内DNS查询呢?

我还真找到了这样的软件!名曰 DNSForwarder

 

 

使用其实很简单,下载回来解压,你可以先看看说明和它的config配置文件,基本上就是全套配置和使用说明了。

最简单的使用方法是,执行和你操作系统匹配的编译版本,然后把你当前活动连接的DNS设置为127.0.0.1(回环地址,是Dnsforwarder默认的请求接收地址),这样的话所有的DNS解析请求都会先送入Dnsforwarder,然后由它来接替系统的解析工作。

默认情况下Dnsforwarder会全局向Google DNS以TCP方式解析地址,也就是说完成了上面的简单操作,你已经可以访问墙外地址了。只不过此时它是全局方式,也就是不分青红皂白一律向Google DNS解析地址,有可能造成国内网站访问缓慢。

如果你对穿墙的要求不高,偶尔看看即可,那么到这里就可以了,要用的时候执行上面的步骤,不用的时候把DNS改回来即可。

现在试试访问Youtube,Google Plus,Facebook等,应该都可以上了,而且速度相当快。

如果不能访问,请检查

1.刷新系统DNS缓存

2.检查访问地址前有没有加https://

3.部分浏览器内部也有DNS缓存,尝试重启浏览器

4.没有看到链接被重置的字样时请耐心等待,有时解析时间较长

5.Twitter等少数网站不仅仅是被DNS污染封锁,所以仍然不能访问

 

下面是进阶篇:

首先强烈建议你看明白作者给的config里的说明,很有帮助

我上文提到的,根据国内外网站区分不同解析方式的配置,其实作者已经写好了。就在“配置文件实例”里面的“防止污染方式二”,把这个txt复制到上层文件夹然后更名为“dnsforwarder.config”覆盖掉原来的即可。然后我建议再做些小调整,用记事本打开这个config文件,你会看到里面分别给TCP Server和UDP Server写好了两组地址。

TCP对应的就是国外网站查询的DNS,UDP则是普通国内网站所使用的。

我的建议是TCP部分使用8.8.8.8,8.8.4.4,作者把4.4的放前面了,我不知是何意义,我个人颠倒过来了。

UDP服务器一般用114.114.114.114的就很好,绝大多数国内运营商支持得都很好,各大网站分配的IP都比较合理。如果你不习惯或者发现速度没以前理想,也可以换成你原来运营商给你分配的两组DNS。

保存好了配置文件,执行相应的exe执行文件即可使用了,同上面一样,记得设置当前连接的DNS!

如果想更惬意些,甚至可以让它开机自启动。Dnsforwarder提供了静默参数,你可以在启动项里添加它!然后加上 -d 参数即可实现静默启动,看不见任何窗口,这样你就可以完全忘记它的存在了,访问国外极速秒开,国内依旧秒开,如此惬意!

 

关于如何添加启动项,这个网上有很多教学,我是用注册表加的.

 

最后说几句:用TCP方式进行DNS解析是一种比较另类的穿墙方式,比起其他VPN代理方式来说,无需花费金钱,且不存在流量中转等同于直接访问,速度非常出色。我个人是非常推崇的,现在连GoAgent都不用了。Host的方法理论效果一致,但是总是需要维护,而且没法涵盖到所有域名,要知道U2B的视频流的节点实在太多,几乎不可能获取完整的域名列表。缺点自然是因为不是所有被封锁的网站都吃这一套的,最起码Twitter就不可以。另外只支持https方式访问,有时会带来些不便,不过反正翻多了,https也成了习惯了,也不算个问题。

还是强烈大家一试的,最起码从性能速度上讲,我还从未见过任何其他方式能够比拟,如此下来收看U2B真的是一种享受!

 

 

另外给不能访问作者博客的朋友们先提供个网盘分流,发表此文时的最新版:http://pan.baidu.com/s/1bnEJC2j

---------------------------------------------------------------

 

DNSForwarder

 

DNSForwarder是一个DNS转发程序-https://wallproxy-plus.googlecode.com/files/DNSForwarder%20v2.2.1.rar,常规DNS查询是走UDP协议,这个是走TCP来躲过GFW的投毒。Goagent启动的时候会通过DNS查找可用IP来连接服务器的,很容易被DNS脏数据干扰。

 

DNSForwarder官方网:https://code.google.com/p/wallproxy-plus/downloads/detail?name=DNSForwarder%20v2.2.1.rar&can=2&q=

 

一个windows用的脚本文件,在DNSForwarder目录里新建一个文件,改名为 run.vbs 再把下面提供的代码拷贝进去,保存后拖到启动里,让开机自动运行,还要把电脑的首选DNS改为 127.0.0.1  这个文件是方便附加运行参数,--d是后台运行,不显示界面,你也可以不建这个脚本,自己每次手动运行。

 

代码:

set oshell = WScript.Createobject ("WSCript.shell")

oshell.run"c:\DNSForwarder_2.2.1\DNSForwarder.exe -d",0

wscript.quit

 

'c:\DNSForwarder_2.2.1 换上你运行目录的路径

'把这个脚本文件拖到“启动”,让开机自动运行

'要把电脑的首选DNS改为 127.0.0.1