{"id":18349825,"url":"https://github.com/zash/lua-unbound","last_synced_at":"2025-04-09T23:47:48.393Z","repository":{"id":77554084,"uuid":"147009903","full_name":"Zash/lua-unbound","owner":"Zash","description":"Lua binding to libunbound (mirror)","archived":false,"fork":false,"pushed_at":"2025-02-01T15:47:00.000Z","size":599,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-09T23:47:44.967Z","etag":null,"topics":["dns","lua"],"latest_commit_sha":null,"homepage":"https://www.zash.se/luaunbound.html","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zash.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-01T15:25:38.000Z","updated_at":"2025-02-01T15:47:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"480a9922-106d-4116-b640-ceda6a14ad19","html_url":"https://github.com/Zash/lua-unbound","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zash%2Flua-unbound","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zash%2Flua-unbound/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zash%2Flua-unbound/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zash%2Flua-unbound/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zash","download_url":"https://codeload.github.com/Zash/lua-unbound/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131460,"owners_count":21052819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dns","lua"],"created_at":"2024-11-05T21:23:54.057Z","updated_at":"2025-04-09T23:47:48.366Z","avatar_url":"https://github.com/Zash.png","language":"C","readme":"# luaunbound\n\nThis is a binding to [libunbound](https://unbound.net/) for\n[Lua](https://www.lua.org/), allowing both asynchronous and\nDNSSEC-secured DNS lookups of arbitrary DNS record types.\n\nIt was created because [Prosody](https://prosody.im/) needs an\nasynchronous DNS library with support for SRV records, and the ones\nfound at the time did one or the other, or was missing DNSSEC that\nallowed implementing\n[DANE](https://www.internetsociety.org/resources/deploy360/dane/).\n\nIt originated out of a need in the [XMPP](https://xmpp.org/) server\nsoftware [Prosody](https://prosody.im/) for an async-capable resolver\nlibrary supporting SRV records, as well as a desire to experiment with\nDNSSEC and new DNS records.\n\n## Downloading\n\nSource can be downloaded with Mercurial from\n\u003chttps://code.zash.se/luaunbound/\u003e.\n\nSigned releases can be found at \u003chttps://code.zash.se/dl/luaunbound/\u003e.\n\nIt is also available from [luarocks](https://luarocks.org/) and can be\ninstalled by\n\n    luarocks install luaunbound\n\n## Building\n\n    make\n\n## API\n\n### Creating a new context\n\nThe lunbound module has a single function, `new()` for creating a new\ncontext. It takes a table with configuration as single optional\nargument. If no argument is given the `config` table on the module will\nbe used.\n\n### Config options\n\n`async`\n:   Uses threads if `true` or forks a process if `false`.\n\n`hoststxt`\n:   Path to `hosts.txt` file. If set to `true` then the default system\n    `hosts.txt` file.\n\n`resolvconf`\n:   Path to resolver configuration. If set to `true` then the default\n    system resolvers are used. Otherwise root hints are used.\n\n`forward`\n:   IP address of an upstream resolver(s) to use, a string or array of\n    strings.\n\n`trusted`\n:   DNSSEC root trust anchors, a string or array of strings.\n\n`trustfile`\n:   Path to a file containing DNSSEC root trust anchors. Can be\n    specified at compile-time (recommended for distributors).\n\n`options`\n:   Table allowing arbitrary settings from `unbound.conf`.\n\nThe built-in defaults are as follows:\n\n``` lua\nlocal resolver = require\"luaunbound\".new({\n    async = true;\n    hoststxt = true;\n    resolvconf = true;\n});\n```\n\n### Context methods\n\n`ctx:resolve(name, type, class)`\n:   Resolves name and returns a table with results.\n\n`ctx:resolve_async(callback, name, type, class)`\n:   Starts a query in async mode. Results are passed to the callback\n    when the query is completed.\n\n`ctx:fd()`\n:   Returns a file descriptor that will appear readable when there are\n    results available.\n\n`ctx:process()`\n:   Calls callbacks for all completed queries.\n\n`ctx:wait()`\n:   Blocks until all outstanding queries are completed and then calls\n    callbacks for all completed queries.\n\n`ctx:poll()`\n:   Returns `true` if new results are available.\n\n### Result table\n\nThe result table closely resembles libunbounds `struct ub_result`.\n\n`qname`, `qtype` and `qclass`\n:   Same as arguments to resolve methods.\n\n`canonname`\n:   The canonical name if the queried name was a CNAME. Note that full\n    CNAME chasing is done by libunbound.\n\n`rcode`, `havedata` and `nxdomain`\n:   The DNS status code and flags indicating if any data is available.\n\n`secure` and `bogus`\n\n:   Indicates DNSSEC validation status. There are three possible\n    combinations:\n\n    -   Results are signed and validation succeeded, `secure` will be\n        `true`.\n    -   Results are signed but validation failed, `secure` will be\n        `false` and `bogus` will be a string with an error message.\n    -   The results were not signed. `secure` will be `false` and\n        `bogus` will be `nil`.\n\nThe actual result data will be in the array part of the result table, in\nthe form of binary strings. It is your job to parse these into whatever\nform you want.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzash%2Flua-unbound","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzash%2Flua-unbound","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzash%2Flua-unbound/lists"}