How to configure a dns server for normal use in mac os?

123 1

The problem is on the.

The question was previously asked, but it seems not clear, so no interest.

我在named里面配置了google.com.zone, 目的在于使用北京的ip上google.com防止google搜索抽风 ( you understand )
My profile is normal.

1 $TTL 86400 
 2 $ORIGIN google.com.
 3 @ 1D IN SOA @ root (
 4 42 ; serial (d. adams)
 5 3H ; refresh
 6 15M ; retry
 7 1W ; expiry
 8 1D ) ; minimum
 9 
 10 1D IN NS @
 11 1D IN A 203.208.46.146
 12 * 1D IN A 203.208.46.146

But it's strange that the configuration of google.com. affects the access of google. Cn, which causes ping to ping, and I looked up a lot of data, 还是TM不明白我设置google.com域名关google.cn鸡毛事了.

Google.

Next, I set the dns for mac os 's network link to 127.0.0.1 and 8.8.4.4, 127.0.0.1 is on top, and there's a thing here, and 's network links seem to directly ignore 127.0.0.1. No matter how I change the order, I can only remove the 8.8.4.4.

Later I changed resovle. Conf to ( no is the default configuration, only the first row ).

nameserver 127.0.0.1
nameserver 8.8.4.4

Well, 从反馈的信息可以发现google.com用了 127.0.0.1 to parse, and then google. Cn uses 8.8.4.4 to parse and also give the final ip address, but google, cn or tm isn't a good thing to do.

And I found that if I'm segmentfault.com等named里面根本没有配置的站点, or I told 127.0.0.1 parsing, this time my world 's outlook and, I didn't mention these sites, why is my native parse. Of course, if named by the default configuration, but why is google, not?

After these two things, I found that the software on the mac os is using the other, logic, so it's a little bit more. And can explain reason in detail.

1 Answers

50 5

Local domain names with no configured domain names are fully understood, because there are no configured domain names. Your dns will be sent to root requests in the root file system.

And the system selects which dns to do the domain name I estimate is random, of course, if a dns isn't available, it'll definitely choose another. But when both dns are available, it can randomly select one of them. You can do an experiment. Different domain names, see if two dns will come out.

...