<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Eduard,<br>
</p>
<div class="moz-cite-prefix">On 24/10/2019 20:28, Eduard Ahmatgareev
via Unbound-users wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAN317tgsvseT6QvkPsb9hpnxJeKHjDLYynnO5ugMUibVOtjUxQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi All,<br>
<br>
I found a lot of examples how it possible to make custom
response for A records in python module, but didn't find any
example to make reponse for PTR records:<br>
</div>
</blockquote>
<p>The append statement takes the full range of syntax that you can
use in a zonefile. One line of it. That includes all types of
records. Just like the syntax of the zonefile, in between the
quotes.</p>
<p>For a PTR record that could look like this:</p>
<p>if qstate.qinfo.qtype == RR_TYPE_PTR:<br>
msg.answer.append("%s 10 IN PTR <a class="moz-txt-link-abbreviated" href="http://www.example.com">www.example.com</a>." %
qstate.qinfo.qname_str)</p>
<p>By the way, also AAAA records can work:</p>
<p>if qstate.qinfo.qtype == RR_TYPE_AAAA:<br>
msg.answer.append("%s 10 IN AAAA 2001:db8::1" %
qstate.qinfo.qname_str)</p>
<p><br>
</p>
<p>Best regards, Wouter</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:CAN317tgsvseT6QvkPsb9hpnxJeKHjDLYynnO5ugMUibVOtjUxQ@mail.gmail.com">
<div dir="ltr"><br>
do you have something like this:<br>
if qstate.qinfo.qtype == RR_TYPE_A:<br>
msg.answer.append("%s 10 IN A 192.168.1.1" %
qstate.qinfo.qname_str)<br>
if (qstate.qinfo.qtype == RR_TYPE_SRV) or (qstate.qinfo.qtype ==
RR_TYPE_ANY):<br>
msg.answer.append("%s 10 IN SRV 0 0 80 <a
href="http://neinfo.example.com" moz-do-not-send="true">neinfo.example.com</a>."
% qstate.qinfo.qname_str)<br>
if (qstate.qinfo.qtype == RR_TYPE_TXT) or (qstate.qinfo.qtype ==
RR_TYPE_ANY):<br>
msg.answer.append("%s 10 IN TXT path=/" %
qstate.qinfo.qname_str)<br>
<br>
but for PTR records?<br>
<br>
</div>
</blockquote>
</body>
</html>