Skip to content

Instantly share code, notes, and snippets.

@alxrdn
alxrdn / dnsmasq_https_rr.py
Last active June 6, 2024 02:52
Generate dnsmasq configuration for HTTPS resource records (RFC 9460)
import dns.rdata # pip3 install dnspython
import io
name = "host.example.com."
rclass = dns.rdataclass.IN
rtype = dns.rdatatype.HTTPS
rdata = '1 . alpn="h3,h2" ipv4hint="XXX.XXX.XXX.XXX"'
rd = dns.rdata.from_text(rclass, rtype, rdata)

Keybase proof

I hereby claim:

  • I am alxrdn on github.
  • I am alxrd (https://keybase.io/alxrd) on keybase.
  • I have a public key whose fingerprint is ED65 9314 E07F 28E1 9D81 94A3 92FF A8A2 E5FE 0192

To claim this, I am signing this object: