[Dnsmasq-discuss] Modification to the feature of config-static DNS record in dual-stack network.
Simon Kelley
simon at thekelleys.org.uk
Fri Nov 26 20:59:59 GMT 2010
许伟林 wrote:
> Thank you for your advice.
>
> Well, I would like dnsmasq to override the domain with IPv6 family, so it
> isn't suitable to modify the hosts file.
>
> I'm sure it's necessary to describe my application. Maybe you have learnt
> that almost all the Top 5 website are blocked by GFW in China, including
> youtube.com and facebook.com. Fortunately the pure IPv6 bone network called
> CERNET2 is well built and the GFW don't block the IPv6 flows. So we users of
> CERNET2 can access the Top 5 websites by IPv6. However the DNS servers of
> Chinese network operators cannot resolve the AAAA record for those Top 5
> sites according to some politics.
>
> Most people modify their hosts file to involve static AAAA records provided
> by this link.
> http://docs.google.com/view?id=dfkdmxnt_61d9ck9ffq
>
> But for some websites like blogspot.com, we need to override the domain
> since we can't add all records of blogs such as william.blogspot.com,
> simon.blogspot.com and etc.
A good cause indeed!
I thought about this a bit more: I don't want to change the default
behavior, which is useful and expected by existing users. But it is
possible to make different behaviour configurable. The trick is to
define what happens when the same domain appears in --address and
--server. We make --address have higher priority for the address family
it specifies, but --server higher priority for the other address family.
So
--address=/opera.com/2001:840:4073:1::1:101
works as we expect for IPv6 and we can send only IPv4 queries to another
server by adding
--server=/opera.com/<server address>
The final thing needed is to note that <server address> can be "#" to
sepcify the normal servers, so
--address=/opera.com/2001:840:4073:1::1:101
--server=/opera.com/#
gives the behaviour you want.
I've put a test version of dnsmasq with this new behavior at
http://www.thekelleys.org.uk/dnsmasq/test-releases/dnsmasq-2.56test18.tar.gz
Please could you try it out and see if it works OK for you?
Cheers,
Simon.
More information about the Dnsmasq-discuss
mailing list