<div>It works! </div><div><br></div><div>Frankly speaking, it is a bit troublesome for me to double the config-items. You see large websites, such as <a href="http://youtube.com">youtube.com</a>, store resources (images, caches and etc.) in different domains and hosts. I have to add dozens items for <a href="http://youtube.com">youtube.com</a>.</div>
<div><br></div><div>Actually I suppose my modification is OK too.</div><div><br></div><div>Two things we need to realise are that </div><div>1) The browser won't send an AAAA DNS query if user's host don't support IPv6;</div>
<div>2) The upstream nameserver will return an empty AAAA record if the network operator doesn't deploy IPv6.</div><div><br></div><div>As a result, if we put an item </div><div>--address = /<domain>/<IPv4 address></div>
<div>on the config file, the browser's IPv6-first behavior won't trouble users:</div><div>1) If the host don't support IPv6, no AAAA query will be sent;</div><div>2) If the network operator hasn't deploy IPv6, the response of empty AAAA record won't affect the web access. Else, users can access the Internet through IPv6. Users will happy to do that since the IPv6 network is usually faster and cheaper.</div>
<div><br></div><div>But considering the actual situation, your scheme is better. Users usually cannot access IPv6 even if the network operator has deploy it since most NAT-router don't support IPv6. What's more, some others may use dnsmasq on the other situation except NAT-router.</div>
<div><br></div><div>I suppose you can take my opinion into account when the IPv6-NAT technology becomes a standard component of the NAT router. My team has achieved the IPv6-NAT technology based on Linux kernel and the other open-source projects including dnsmasq. We would like to share it with people.</div>
<div><br></div><div>--</div><div>William</div><br><div class="gmail_quote">在 2010年11月27日 上午4:59,Simon Kelley <span dir="ltr"><<a href="mailto:simon@thekelleys.org.uk">simon@thekelleys.org.uk</a>></span>写道:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">许伟林 wrote:<br>
> Thank you for your advice.<br>
><br>
> Well, I would like dnsmasq to override the domain with IPv6 family, so it<br>
> isn't suitable to modify the hosts file.<br>
><br>
> I'm sure it's necessary to describe my application. Maybe you have learnt<br>
> that almost all the Top 5 website are blocked by GFW in China, including<br>
> <a href="http://youtube.com" target="_blank">youtube.com</a> and <a href="http://facebook.com" target="_blank">facebook.com</a>. Fortunately the pure IPv6 bone network called<br>
> CERNET2 is well built and the GFW don't block the IPv6 flows. So we users of<br>
> CERNET2 can access the Top 5 websites by IPv6. However the DNS servers of<br>
> Chinese network operators cannot resolve the AAAA record for those Top 5<br>
> sites according to some politics.<br>
><br>
> Most people modify their hosts file to involve static AAAA records provided<br>
> by this link.<br>
> <a href="http://docs.google.com/view?id=dfkdmxnt_61d9ck9ffq" target="_blank">http://docs.google.com/view?id=dfkdmxnt_61d9ck9ffq</a><br>
><br>
> But for some websites like <a href="http://blogspot.com" target="_blank">blogspot.com</a>, we need to override the domain<br>
> since we can't add all records of blogs such as <a href="http://william.blogspot.com" target="_blank">william.blogspot.com</a>,<br>
> <a href="http://simon.blogspot.com" target="_blank">simon.blogspot.com</a> and etc.<br>
<br>
</div>A good cause indeed!<br>
<br>
I thought about this a bit more: I don't want to change the default<br>
behavior, which is useful and expected by existing users. But it is<br>
possible to make different behaviour configurable. The trick is to<br>
define what happens when the same domain appears in --address and<br>
--server. We make --address have higher priority for the address family<br>
it specifies, but --server higher priority for the other address family.<br>
<br>
So<br>
<br>
--address=/<a href="http://opera.com/2001:840:4073:1::1:101" target="_blank">opera.com/2001:840:4073:1::1:101</a><br>
<br>
works as we expect for IPv6 and we can send only IPv4 queries to another<br>
server by adding<br>
<br>
--server=/<a href="http://opera.com/" target="_blank">opera.com/</a><server address><br>
<br>
The final thing needed is to note that <server address> can be "#" to<br>
sepcify the normal servers, so<br>
<br>
--address=/<a href="http://opera.com/2001:840:4073:1::1:101" target="_blank">opera.com/2001:840:4073:1::1:101</a><br>
--server=/<a href="http://opera.com/#" target="_blank">opera.com/#</a><br>
<br>
gives the behaviour you want.<br>
<br>
I've put a test version of dnsmasq with this new behavior at<br>
<br>
<a href="http://www.thekelleys.org.uk/dnsmasq/test-releases/dnsmasq-2.56test18.tar.gz" target="_blank">http://www.thekelleys.org.uk/dnsmasq/test-releases/dnsmasq-2.56test18.tar.gz</a><br>
<br>
Please could you try it out and see if it works OK for you?<br>
<br>
Cheers,<br>
<font color="#888888"><br>
Simon.<br>
<br>
<br>
<br>
</font></blockquote></div><br>