[dnsdist] dnsdist 1.7 : allow only A request

david.neau at orange.com david.neau at orange.com
Fri Mar 17 15:23:39 UTC 2023

Hello all

After some tests I see a potential issue, tell me if I m right please :

It works for A request :
[root at node ~]# dig a www.toto.com @X.X.X.X +short

It stays mute more most of the requests ( expected behavior ), ^C is needed to get the prompt back.

[root at node ~]# dig ns www.toto.com @X.X.X.X
[root at node ~]# dig mx www.toto.com @X.X.X.X
[root at node ~]# dig soa www.toto.com @X.X.X.X
[root at node ~]# dig txt www.toto.com @X.X.X.X

BUT : for the "any" request I have this result, and I don't know if it can produce something bad, have you any idea ?

[root at node ~]# dig any www.toto.com @X.X.X.X
;; communications error to X.X.X.X#53: end of file
;; communications error to X.X.X.X#53: end of file

Thanks and regards

Orange Restricted

-----Message d'origine-----
Envoyé : lundi 13 mars 2023 14:39
À : Jacob Bunk Nielsen <jbn at one.com>; dnsdist at mailman.powerdns.com
Objet : RE: [dnsdist] dnsdist 1.7 : allow only A request

Hello Jacob,

I did this :

        NotRule (
                OrRule {QTypeRule(DNSQType.A), QTypeRule(DNSQType.AAAA)}

And it works as expected :

> showRules()
#   Name                             Matches Rule                                                     Action
0                                          0 !((qtype==A) || (qtype==AAAA))                           allow

Thanks for your help


Orange Restricted

-----Message d'origine-----
De : dnsdist <dnsdist-bounces at mailman.powerdns.com> De la part de Jacob Bunk Nielsen via dnsdist Envoyé : lundi 13 mars 2023 06:41 À : dnsdist at mailman.powerdns.com Objet : Re: [dnsdist] dnsdist 1.7 : allow only A request

On 10/03/2023 09.21, david n via dnsdist wrote:
> I tried to explicitly deny the most current DNS requests like for ex :
> -- refused query type :
> 	addAction(QTypeRule(dnsdist.ANY), DropAction())
> 	addAction(QTypeRule(dnsdist.SOA), DropAction())

With dnsdist 1.4 (as far as I remember) those names for the various query types changed, so dnsdist.ANY became DNSQType.ANY.

For your particular case of only wanting to serve A and AAAA records I would probably just do (untested):


With all the warnings that Stephane already gave you about why this is a bad idea.

You can replace RCodeAction(DNSRCode.REFUSED) with DropAction() if you don't even want to reply with a REFUSED response.

Best regards,


dnsdist mailing list
dnsdist at mailman.powerdns.com


Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

More information about the dnsdist mailing list