Skip to content

Commit

Permalink
Added support for HTTPS records (iphelix/dnschef#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
byt3bl33d3r committed Sep 28, 2023
1 parent e6e14df commit d5716ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dnschef.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@

[RRSIG]
; FORMAT: covered algorithm labels labels orig_ttl sig_exp sig_inc key_tag name base64(sig)
*.thesprawl.org=A 5 3 86400 20030322173103 20030220173103 2642 thesprawl.org. oJB1W6WNGv+ldvQ3WDG0MQkg5IEhjRip8WTrPYGv07h108dUKGMeDPKijVCHX3DDKdfb+v6oB9wfuh3DTJXUAfI/M0zmO/zz8bW0Rznl8O3tGNazPwQKkRN20XPXV6nwwfoXmJQbsLNrLfkGJ5D6fwFm8nN+6pBzeDQfsS3Ap3o=
*.thesprawl.org=A 5 3 86400 20030322173103 20030220173103 2642 thesprawl.org. oJB1W6WNGv+ldvQ3WDG0MQkg5IEhjRip8WTrPYGv07h108dUKGMeDPKijVCHX3DDKdfb+v6oB9wfuh3DTJXUAfI/M0zmO/zz8bW0Rznl8O3tGNazPwQKkRN20XPXV6nwwfoXmJQbsLNrLfkGJ5D6fwFm8nN+6pBzeDQfsS3Ap3o=

[HTTPS]
;format: priority target key=value pairs
*.thesprawl.org=1 . alpn=h2 ipv4hint=127.0.0.1 ipv6hint=::1
5 changes: 5 additions & 0 deletions dnschef/kitchen.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ async def do_AAAA(self, addr, record, qname, qtype):
ipv6_hex_tuple = list(map(int, ip_address(record).packed))
return RR(qname, getattr(QTYPE, qtype), rdata=RDMAP[qtype](ipv6_hex_tuple))

async def do_HTTPS(self, addr, record, qname, qtype):
kv_pairs = record.split(" ")
mydata = RDMAP[qtype].fromZone(kv_pairs)
return RR(qname, getattr(QTYPE, qtype), rdata=mydata)

async def do_SOA(self, addr, record, qname, qtype):
mname, rname, t1, t2, t3, t4, t5 = record.split(" ")
times = tuple([int(t) for t in [t1, t2, t3, t4, t5]])
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ structlog = "^23.1.0"

[tool.poetry.scripts]
dnschef = 'dnschef.__main__:main'
dnschef-ng = 'dnschef.__main__:main'

[tool.poetry.group.api.dependencies]
fastapi = "^0.103.1"
Expand Down

0 comments on commit d5716ba

Please sign in to comment.