[Twisted-Python] DNS custom response (NXDOMAIN)

Rob Gormley robert at gormley.me
Wed Aug 5 16:59:58 MDT 2020


Hello:

I am trying to implement a custom DNS resolver, using the DNS Howto custom resolver as a boiler plate. I have a database-driven cache that I am reading from, but am unsure how to implement a cache ‘miss’ (i.e. NXDOMAIN).

The ‘hit’ is fine, apropos to:

answer = dns.RRHeader(
    name=name,
    payload=dns.Record_A(address=b’127.0.0.1’))  # for example sake

But I tried with dns.Record_NULL to generate an NXDOMAIN-like response without success. How can I implement this?

Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20200805/c619b761/attachment.htm>


More information about the Twisted-Python mailing list