自建DNS并合理调用国内外DNS

2014-05-11 Comments Off on 自建DNS并合理调用国内外DNS

由于某些原因, 一直喜欢用Google的DNS 8.8.8.8 / 8.8.4.4 以及OPENDNS, 但用了它们之后, 访问国内一些网站变得很慢. 考虑过自己设一台DNS服务器, 但没有去尝试.

最近无意中看到这篇文章这篇文章, 很快就在windows里面设置好了, 效果不错.

我用的是Dual DHCP DNS Server, 设置DualServer.ini 的几个关键点如下:

* 关于LISTEN_ON这个, 127.0.0.1是无法设置上去的, 必须是静态设置的IP地址才可以.
* 关于CONDITIONAL_FORWARDERS, 可以到这里找别人整理好的, 之后自己把它改成Dual DHCP DNS Server的格式就好了
* 如果找不到哪里有问题, 用RunStandAlone.bat开启服务可以看到相应的错误提示.


[SERVICES]
#Specify the service you want to use
#Default is both services
DNS
;DHCP


[LISTEN_ON]
#Specify the Interfaces you would like Server to listen
#if you have more than one NIC card on your server
#always specify which cards will listen DHCP/DNS requests
#Requests from diffent Interfaces look for matching DHCP ranges.
#Requests from relay agents look for matching range to relay agent IP.
#upto 125 interfaces can be specified.
#Default is all Static interfaces
;192.168.0.1
;127.0.0.1


[DNS_ALLOWED_HOSTS]
#These are permitted hosts for DNS Query.
#Hosts having IP address within these ip ranges
#only will be responded to DNS requests.
#Hosts "queried for" has nothing to do with these ranges.
#125 ranges can be specified.
#DHCP Client ranges are automatically included
#use second example for allowing all hosts
192.168.0.1-192.168.255.254
;1.0.0.1-255.255.255.254
;127.0.0.1


[DNS_ALLOWED_HOSTS]
#These are permitted hosts for DNS Query.
#Hosts having IP address within these ip ranges
#only will be responded to DNS requests.
#Hosts "queried for" has nothing to do with these ranges.
#125 ranges can be specified.
#DHCP Client ranges are automatically included
#use second example for allowing all hosts
192.168.0.1-192.168.255.254
;1.0.0.1-255.255.255.254
;127.0.0.1


[CONDITIONAL_FORWARDERS]
#In previous versions this was called CHILD_ZONES.
#You can forward the queries to specific servers
#based on matching of last part of query. Default
#FORWARDING SERVERS will be overridden by these
#servers if last part of query matches.
#If your main domain has child zones and
#each child zone has its own DNS
#Server(s), DualServer can also be used domain
#name server for all zones as main Domain Name Server.
#The queries would be forwarded to these child
#servers. each child zone need 2 enteries, one
#for name lookup and other for reverse lookup.
#Limit is 64 entries. Each such entry can
#have upto 2 child DNS Servers, separated
#by comma. Wild cards not allowed here.
;zone1.workgroup.com=192.168.1.1
;1.168.192.in-addr.arpa=192.168.1.1
;zone2.workgroup.com=192.168.2.1, 192.168.2.2
;2.168.192.in-addr.arpa=192.168.2.1, 192.168.2.2
115.com=114.114.114.114
123u.com=114.114.114.114
126.com=114.114.114.114