{"id":19592017,"url":"https://github.com/catalyst/pdns-cli","last_synced_at":"2025-04-27T14:33:35.458Z","repository":{"id":45367100,"uuid":"155785482","full_name":"catalyst/pdns-cli","owner":"catalyst","description":"Command line client for the PowerDNS HTTPS API","archived":false,"fork":false,"pushed_at":"2023-03-28T19:48:32.000Z","size":67,"stargazers_count":7,"open_issues_count":3,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-05T00:51:12.275Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catalyst.png","metadata":{"files":{"readme":"README.md","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-11-01T22:52:48.000Z","updated_at":"2024-07-09T19:53:49.000Z","dependencies_parsed_at":"2024-11-11T08:34:35.188Z","dependency_job_id":"4726ec95-cb5f-416e-a512-ef40180cb70d","html_url":"https://github.com/catalyst/pdns-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fpdns-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fpdns-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fpdns-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fpdns-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catalyst","download_url":"https://codeload.github.com/catalyst/pdns-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251154669,"owners_count":21544538,"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":[],"created_at":"2024-11-11T08:32:34.881Z","updated_at":"2025-04-27T14:33:34.587Z","avatar_url":"https://github.com/catalyst.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerDNS HTTPS API client\n\nThis a PowerDNS HTTPS API client implementation in Python. For more information about the PowerDNS API see [the PowerDNS documentation](https://doc.powerdns.com/authoritative/http-api/).\n\n## Getting started\n\n### Prerequisites\n\n[python-requests](http://docs.python-requests.org/)\n\n[toml](https://pypi.org/project/toml/0.9.2/)\n\n[colored](https://pypi.org/project/colored/)\n\n[argcomplete](http://argcomplete.readthedocs.io/en/latest/index.html)\n\n### Installing\n\nCreate a virtual environment and install the necessary packages:\n\n```\npip install -r requirements.txt\n```\n\n## Example usage\n\nAdding a `www` hostname to the `localhost` server for the `example.org` domain, with an A record of `192.0.5.9`\n\nThe zone name must always end with a `.` character so it is \"full qualified\".\n\n```\n# with config file\n./pdns -c conf.toml edit-rrset --add example.org. www A 192.0.5.9\n# without\n./pdns -a user:token -u https://dns.example.com/api/v1/ -s localhost edit-rrset --add example.org. www A 192.0.5.9\n```\n\nEditing the `www` hostname to have a different IP for the `A` record:\n\n```\n./pdns -c conf.toml edit-rrset --replace example.org. www A 192.0.5.10\n./pdns -a user:token -u https://dns.example.com/api/v1/ -s localhost edit-rrset --replace example.org. www A 192.0.5.10\n```\n\nList RRsets in the `example.org` zone:\n\n```\n./pdns -c conf.toml show-rrsets localhost example.org.\n./pdns -a user:token -u https://dns.example.com/api/v1/ -s localhost show-rrsets localhost example.org.\n```\n\nChanging an RRsets type requires deleting the old RRset and adding it as the new type as two operations\n\nTo add records to the root of a domain, you specify the full dns path of the domain (including root dot) as the target rrset, eg.\n```\npdns -c conf.toml edit-rrset example.org --add --ttl 60 example.org. NS ns1.bogus.com.\n```\n\n## Configuration\n\nWhile you can specify at runtime all details required to connect to a PowerDNS API, it's much more ergonomic to instead use a configuration file. This is a file in the [.toml](https://github.com/toml-lang/toml) format located in one of the following two places\n\n- the path specified in the `PDNS_CLI_CONF_PATH` os environment variable\n- the path provided by the optional cli argument `-c or --config-path`\n\nThe format is documented in the [conf.toml.dist](https://gitlab.catalyst.net.nz/elearning/pdns-cli/blob/master/conf.toml.dist) file included in the repository and allows you to specify standard details for your environment\n\nThings you can specify include\n- PowerDNS API URL\n- The server id to operate on\n- You can specify multiple users and a list of zones each user is for, pdns-cli will select the appropriate user based on the zone being edited\n\nUsing the `-c` command has precedence over the environment variable, so you can have a default configuration file and then override on an as needed basis\n\nUsing a configuration file is highly recommended - compare:\n\n```\n./pdns edit-rrset --add example.org. www A 192.0.5.9\n./pdns edit-rrset --add notexample.org. www CNAME example.org.\n```\n\nand\n\n```\n./pdns -k superawesomekey -u https://yourdnsapi.com/api/v1/ -s localhost edit-rrset --add example.org. www A 192.0.5.9\n./pdns -k superawesomekey2 -u https://yourdnsapi.com/api/v1/ -s localhost edit-rrset --add notexample.org. www CNAME example.org.\n```\n\n## Full command list \n**A ! at the command start indicates unimplemented API calls**\n```\nusage: pdns [-h] [-a USERNAME:PASSWORD] [-k API_KEY] [-i] [-c CONFIG_PATH]\n            [-u URL] [-s SERVER]\n            action ...\n\nCLI client for the PowerDNS API\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -a USERNAME:PASSWORD, --auth USERNAME:PASSWORD\n                        credentials for Basic authentication\n  -k API_KEY, --api-key API_KEY\n                        API key\n  -i, --insecure        allow insecure TLS connections\n  -c CONFIG_PATH, --config-path CONFIG_PATH\n                        give a different config file path\n  -u URL, --url URL     PowerDNS API URL\n  -s SERVER, --server SERVER\n                        server ID\n\nactions:\n  action\n    list-servers        list servers\n    show-server         show details for a server\n    !add-server          add a new server (pdnscontrol only)\n    !edit-server         add a new server (pdnscontrol only)\n    delete-server       delete a server (pdnscontrol only)\n    list-config         list config settings\n    list-zones          list zones\n    show-zone           show details for a zone\n    add-zone            add a new zone, return zone ID\n    edit-zone           add a new zone\n    delete-zone         delete a zone\n    show-rrsets         show Resource Record sets for a zone\n    edit-rrset          add/replace/delete a record in Resource Record set\n    delete-rrset        delete a Resource Record set\n    edit-rrset-comments add/replace/delete a comment in Resource Record set\n    notify              send a DNS NOTIFY to all slaves for a zone\n    !axfr-retrieve       retrieve a zone from the master\n    !export              export a zone in AXFR format\n    !check               verify a zone content/configuration\n    !list-metadata       list all metadata for a zone\n    !show-metadata       show metadata of a given kind for a zone\n    !add-metadata        add a new set of metadata for a zone\n    !edit-metadata       edit a set of metadata for a zone\n    !delete-metadata     delete all metadata of a given kind for a zone\n    !list-cryptokeys     list all cryptokeys from a zone\n    !show-cryptokey      show a cryptokey from a zone\n    !add-cryptokey       add a new cryptokey to a zone\n    !edit-cryptokey      edit a cryptokey from a zone\n    !delete-cryptokey    delete a cryptokey from a zone\n    !search              search across all zones, records and comments\n    !search-log          search in the log\n    !statistics          show internal statistics\n    !flush-cache         flush the cache for a given domain name\n```\n## TODO\n\nSee [TODO](TODO.md).\n\n## Authors\n\n* **Pierre Guinoiseau** - *Initial work*\n* **Francis Devine** - *Configuration files*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalyst%2Fpdns-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatalyst%2Fpdns-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalyst%2Fpdns-cli/lists"}