<div>It works!&nbsp;</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&nbsp;</div><div>1) The browser won&#39;t send an AAAA DNS query if user&#39;s host don&#39;t support IPv6;</div>
<div>2) The upstream nameserver will return an empty AAAA record if the network operator doesn&#39;t deploy IPv6.</div><div><br></div><div>As a result, if we put an item&nbsp;</div><div>--address = /&lt;domain&gt;/&lt;IPv4 address&gt;</div>
<div>on the config file, the browser&#39;s IPv6-first behavior won&#39;t trouble users:</div><div>1) If the host don&#39;t support IPv6, no AAAA query will be sent;</div><div>2) If the network operator hasn&#39;t deploy IPv6, the response of empty AAAA record won&#39;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&#39;t support IPv6. What&#39;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">&lt;<a href="mailto:simon@thekelleys.org.uk">simon@thekelleys.org.uk</a>&gt;</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>
&gt; Thank you for your advice.<br>
&gt;<br>
&gt; Well, I would like dnsmasq to override the domain with IPv6 family, so it<br>
&gt; isn&#39;t suitable to modify the hosts file.<br>
&gt;<br>
&gt; I&#39;m sure it&#39;s necessary to describe my application. Maybe you have learnt<br>
&gt; that almost all the Top 5 website are blocked by GFW in China, including<br>
&gt; <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>
&gt; CERNET2 is well built and the GFW don&#39;t block the IPv6 flows. So we users of<br>
&gt; CERNET2 can access the Top 5 websites by IPv6. However the DNS servers of<br>
&gt; Chinese network operators cannot resolve the AAAA record for those Top 5<br>
&gt; sites according to some politics.<br>
&gt;<br>
&gt; Most people modify their hosts file to involve static AAAA records provided<br>
&gt; by this link.<br>
&gt; &nbsp;<a href="http://docs.google.com/view?id=dfkdmxnt_61d9ck9ffq" target="_blank">http://docs.google.com/view?id=dfkdmxnt_61d9ck9ffq</a><br>
&gt;<br>
&gt; But for some websites like <a href="http://blogspot.com" target="_blank">blogspot.com</a>, we need to override the domain<br>
&gt; since we can&#39;t add all records of blogs such as <a href="http://william.blogspot.com" target="_blank">william.blogspot.com</a>,<br>
&gt; <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&#39;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>&lt;server address&gt;<br>
<br>
The final thing needed is to note that &lt;server address&gt; can be &quot;#&quot; 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&#39;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>