<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't suitable to modify the hosts file.</div><div><br></div><div>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 <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'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. </div>
<div><br></div><div>Most people modify their hosts file to involve static AAAA records provided by this link.</div><div> <a href="http://docs.google.com/view?id=dfkdmxnt_61d9ck9ffq">http://docs.google.com/view?id=dfkdmxnt_61d9ck9ffq</a> </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'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'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"><<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>
> Hi all,<br>
> When you add an item '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>' in<br>
> '/etc/dnsmasq.conf', do you mean this site doesn't have an IPv4 address to<br>
> access? I wonder it is not true on most occasion, since this kind of sites<br>
> can only be accessed by IPv6 host.<br>
><br>
> However, when you add this item in the config file, dnsmasq-2.55 will reply<br>
> 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>
> in log file:<br>
> *...*<br>
> *dnsmasq: query[A] <a href="http://www.opera.com" target="_blank">www.opera.com</a> from 192.168.56.101*<br>
> *dnsmasq: config <a href="http://www.opera.com" target="_blank">www.opera.com</a> is NODATA-IPv4*<br>
> *...*<br>
><br>
> So the pure IPv4 hosts cannot access <a href="http://www.opera.com" target="_blank">www.opera.com</a>.<br>
><br>
> Actually the below feature is what I expected:<br>
> *When receiving a DNS query request, dnsmasq firstly looks up the static<br>
> record of the same type (A record or AAAA record) in config file. The client<br>
> will receive the static DNS record if found. Or the query should be<br>
> forwarded to the external DNS server.*<br>
><br>
> In order to realise this feature, we have to modify some codes in<br>
> ./src/forward.c.<br>
><br>
</div><snip patch><br>
<br>
> William<br>
><br>
><br>
<br>
Well done for getting your head around that code; it'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 = /<domain>/<IPv4 address><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'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't affect forwarding of other queries.<br>
<br>
<br>
I hope that'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>