<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="#0563C1" vlink="#954F72" style="text-justify-trim:punctuation">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">For the firest question, if more than one one entry, not in strict-order, dnsmasq will forward the query to all nameservers according to matching rules which are set by these entries.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">For the second question, when dnsmasq start with
<a href="mailto:–server=/xpto.biz/192.168.1.1@tun0">–server=/xpto.biz/192.168.1.1@tun0</a>, dnsmasq will call setsockopt() in local_bind() and try to bind socket with device. if bind not success, dnsmasq will drop this query.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">gdb info<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#0 local_bind (fd=fd@entry=12, addr=addr@entry=0xaaaaaab143ac, intname=intname@entry=0xaaaaaab143c8 "tuno", ifindex=0, is_tcp=is_tcp@entry=0) at network.c:1235<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#1 0x0000aaaaaaabf7fc in random_sock (s=s@entry=0xaaaaaab14390) at forward.c:2185<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#2 0x0000aaaaaaac12a0 in allocate_rfd (fdlp=0xaaaaaab1c160, serv=0xaaaaaab14390) at forward.c:2290<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#3 0x0000aaaaaaac1b50 in forward_query (udpfd=0, udpaddr=udpaddr@entry=0xfffffffff068, dst_addr=0xaaaaaaac71dc <check_dns_listeners+924>,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> dst_addr@entry=0xfffffffff0c8, dst_iface=65535, dst_iface@entry=2, header=header@entry=0xaaaaaab154a0, plen=63, plen@entry=0, now=now@entry=1647934955,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> forward=<optimized out>, forward@entry=0x0, ad_reqd=<optimized out>, ad_reqd@entry=1, do_bit=<optimized out>, do_bit@entry=-1431225600) at forward.c:511<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#4 0x0000aaaaaaac2868 in receive_query (listen=0xaaaaaab14980, now=1647934955) at forward.c:1583<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#5 0x0000aaaaaaac71dc in check_dns_listeners (now=1647934955) at dnsmasq.c:1786<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#6 0x0000aaaaaaaac074 in main (argc=<optimized out>, argv=<optimized out>) at dnsmasq.c:1207<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>