<div><div>Thank you for your advice.</div><div><br></div><div>Well, I would like dnsmasq to override the domain with IPv6 family, so it isn&#39;t suitable to modify the hosts file.</div><div><br></div><div>I&#39;m sure it&#39;s necessary to describe my application. Maybe you have learnt that almost all the Top 5 website are blocked by GFW in China, including <a href="http://youtube.com">youtube.com</a> and <a href="http://facebook.com">facebook.com</a>. Fortunately the pure IPv6 bone network called CERNET2 is well built and the GFW don&#39;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.&nbsp;</div>
<div><br></div><div>Most people modify their hosts file to involve static AAAA records provided by this link.</div><div>&nbsp;<a href="http://docs.google.com/view?id=dfkdmxnt_61d9ck9ffq">http://docs.google.com/view?id=dfkdmxnt_61d9ck9ffq</a>&nbsp;</div>
<div><br></div><div>But for some websites like <a href="http://blogspot.com">blogspot.com</a>, we need to override the domain since we can&#39;t add all records of blogs such as <a href="http://william.blogspot.com">william.blogspot.com</a>, <a href="http://simon.blogspot.com">simon.blogspot.com</a> and etc.</div>
<div><br></div><div>I have installed the modified-dnsmasq into my dual-stack NAT router. The IPv6-stack hosts and dual-stack hosts behind the NAT router can access these websites by IPv6. The other pure IPv4-stack hosts can also access these sites by conventional means of IPv4, such as VPN or proxy server(Google AppEngine have provided a good one!). Without the modification of codes, it&#39;s impossible for those pure IPv4 hosts to access the sites since they only get an empty [A] record.</div>
<div><br></div><div>In any case, we can explore the world freely now! Thank you for excellent job!</div><div><br></div><div>--</div><div>William</div></div><div><br><div class="gmail_quote">2010/11/26 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; Hi all,<br>
&gt; When you add an item &#39;address=/<a href="http://www.opera.com/2001:840:4073:1::1:101" target="_blank">www.opera.com/2001:840:4073:1::1:101</a>&#39; in<br>
&gt; &#39;/etc/dnsmasq.conf&#39;, do you mean this site doesn&#39;t have an IPv4 address to<br>
&gt; access? I wonder it is not true on most occasion, since this kind of sites<br>
&gt; can only be accessed by IPv6 host.<br>
&gt;<br>
&gt; However, when you add this item in the config file, dnsmasq-2.55 will reply<br>
&gt; an empty record for the DNS query[A] of <a href="http://www.opera.com" target="_blank">www.opera.com</a>. And it prints 2 lines<br>
&gt; in log file:<br>
&gt; *...*<br>
&gt; *dnsmasq: query[A] <a href="http://www.opera.com" target="_blank">www.opera.com</a> from 192.168.56.101*<br>
&gt; *dnsmasq: config <a href="http://www.opera.com" target="_blank">www.opera.com</a> is NODATA-IPv4*<br>
&gt; *...*<br>
&gt;<br>
&gt; So the pure IPv4 hosts cannot access <a href="http://www.opera.com" target="_blank">www.opera.com</a>.<br>
&gt;<br>
&gt; Actually the below feature is what I expected:<br>
&gt; *When receiving a DNS query request, dnsmasq firstly looks up the static<br>
&gt; record of the same type (A record or AAAA record) in config file. The client<br>
&gt; will receive the static DNS record if found. Or the query should be<br>
&gt; forwarded to the external DNS server.*<br>
&gt;<br>
&gt; In order to realise this feature, we have to modify some codes in<br>
&gt; ./src/forward.c.<br>
&gt;<br>
</div>&lt;snip patch&gt;<br>
<br>
&gt; William<br>
&gt;<br>
&gt;<br>
<br>
Well done for getting your head around that code; it&#39;s really obscure<br>
and should be re-written.<br>
<br>
The current behaviour is sort-of deliberate, because often people want to do<br>
<br>
--address = /&lt;domain&gt;/&lt;IPv4 address&gt;<br>
<br>
and be sure that they have overridden that domain. If IPv6 queries for<br>
the domain were let through, that would cause a surprise: Many users<br>
don&#39;t even know that their browser, for instance, might try and make<br>
IPv6 connections.<br>
<br>
You can get the behaviour you are looking for by putting<br>
<br>
2001:840:4073:1::1:101 <a href="http://www.opera.com" target="_blank">www.opera.com</a><br>
<br>
into /etc/hosts. Addresses there are used strictly for one address<br>
family and don&#39;t affect forwarding of other queries.<br>
<br>
<br>
I hope that&#39;s a suitable work-around for your application.<br>
<br>
<br>
Cheers,<br>
<font color="#888888"><br>
Simon.<br>
<br>
<br>
</font></blockquote></div><br></div>