Skip to content

Instantly share code, notes, and snippets.

@zeha
Created August 1, 2018 15:27
Show Gist options
  • Save zeha/7e80fd73b92dbf0dbed9f1b42118df15 to your computer and use it in GitHub Desktop.
Save zeha/7e80fd73b92dbf0dbed9f1b42118df15 to your computer and use it in GitHub Desktop.
function load_rootkeys()
root_key_path = "/usr/share/dns/root.ds"
print("LUA: Loading DNSSEC root keys from " .. root_key_path)
-- . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5
for line in io.lines(root_key_path) do
ds = string.match(line, "^%.%s+IN%s+DS%s+(%d+%s+%d+%s+%d+%s+%S+)")
if ds then
print("LUA: Adding DS: " .. ds)
addDS(".", ds)
end
end
end
load_rootkeys()
@zeha
Copy link
Author

zeha commented Aug 7, 2018

TODO (thanks @Habbie @rgacogne):

  • print -> pdnslog
  • clearDS() if any DS found
  • install into /usr/... and include from /etc/powerdns/recursor.lua plus comment
  • talk to ondrej about the file format ("set in stone?")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment