{"id":21091386,"url":"https://github.com/andreasscherbaum/bind-dynamic-dns-update","last_synced_at":"2025-12-29T14:45:25.890Z","repository":{"id":10524027,"uuid":"12714723","full_name":"andreasscherbaum/bind-dynamic-dns-update","owner":"andreasscherbaum","description":"Scripts to update a dynamic Bind DNS entry","archived":false,"fork":false,"pushed_at":"2013-09-11T22:45:18.000Z","size":116,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T01:13:56.459Z","etag":null,"topics":["bind","bind9","dns","dns-server","dynamic","nsupdate","perl","transfer","zone"],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"flowtype/flow-bin","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreasscherbaum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-09T22:40:51.000Z","updated_at":"2024-06-03T07:34:55.000Z","dependencies_parsed_at":"2022-08-30T18:31:02.526Z","dependency_job_id":null,"html_url":"https://github.com/andreasscherbaum/bind-dynamic-dns-update","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/andreasscherbaum%2Fbind-dynamic-dns-update","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fbind-dynamic-dns-update/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fbind-dynamic-dns-update/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fbind-dynamic-dns-update/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreasscherbaum","download_url":"https://codeload.github.com/andreasscherbaum/bind-dynamic-dns-update/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243533043,"owners_count":20306255,"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":["bind","bind9","dns","dns-server","dynamic","nsupdate","perl","transfer","zone"],"created_at":"2024-11-19T21:45:36.900Z","updated_at":"2025-12-29T14:45:25.856Z","avatar_url":"https://github.com/andreasscherbaum.png","language":"Perl","readme":"bind-dynamic-dns-update\n=======================\n\nScripts to update a dynamic Bind DNS entry\n\n\n############################################################\nHistory\n\nMany people use free Dynamic DNS services to reach systems behind dynamic\nIP addresses. Many of the free services limited their service offer over\nthe time, or the service depends on buying a product (like a DSL router).\n\nWith bind9 it is easily possible to setup your own dynamic DNS service.\n\nThis set of scripts use the 'nsupdate' tool and authenticated communication,\nto update the DNS entries.\n\n\n\n############################################################\nFiles\n\nbin/dns-update.pl\n\nThe script which executes the update.\n\nParameters:\n- key file\n- dynamic DNS hostname\n- new IP address\n\n\nconf/transfer.key\n\nExample configuration file (hint: the key in the file is just\na demo, change it!) For the purpose of \"dns-update.pl\", only the\nfirst section is required.\n\n\nconf/ontheroad.example.com.zone\n\nExample zone.\n\n\nhttp/my_ip.php\n\nScript which returns the current IP address used by the client.\n\n\nhttp/dynamic-update.php\n\nScript which updates the dynamic DNS entry for the client.\n\n\n\n############################################################\nBind9 configuration\n\nSince the dynamic updates are written to a separate file, it\nmakes sense to store the entire hostname in a separate file.\nMake sure that bind9 can create new files in this directory:\n\nmkdir /etc/bind/updates\nchown bind:bind /etc/bind/updates\n\n\nAdd to /etc/bind/named.conf.local:\n\ninclude \"/etc/bind/transfer.key\";\nzone \"ontheroad.example.com\" {\n        type master;\n        file \"/etc/bind/updates/ontheroad.example.com.zone\";\n        allow-transfer {\n                key \"transfer\";\n        };\n        allow-update {\n                key \"transfer\";\n        };\n};\n\n\nA sample file for the \"ontheroad.example.com\" zone, as well\nas a \"transfer.key\" example are included in the conf/ directory.\nMake the changes and reload the bind9 configuration. Make sure\nthat there are no errors.\n\n\n\n############################################################\nHow to dynamic update the hostname?\n\n./dns-update.pl transfer.key ontheroad.example.com 10.0.0.20\n\nUsing another website which returns the current public IP address,\nthis script can be used in a cron job, or whenever an interface\nis coming up. See also the \"webserver\" section later in this\ndocument:\n\n./dns-update.pl transfer.key ontheroad.example.com `lynx -source -dump http://example.com/my_ip.php`\n\n\n\n############################################################\nHow to generate the bind9 key?\n\nHere's a way to generate the key for bind9:\n\ncd /tmp/\ndnssec-keygen -a HMAC-MD5 -b 256 -n HOST transfer\nls -ld *transfer*\n\nThe file ending on \".key\" contains a new key.\n\n\n\n############################################################\nUsing a webserver for clients without 'nsupdate' program\n\nIn case a client has no 'nsupdate' program (embedded client,\nmobile client, ...), a webserver can play the relay for updating\nthe dynamic DNS entry.\n\nThe \"http/\" directory contains two small PHP scripts.\n\n\"my_ip.php\" just returns the official IP address used by the\nclient. This can be used to execute \"dns-update.pl\", when behind\na NAT.\n\n\"dynamic-update.php\" is called with a 'host' parameter, then\nthe script will update the dynamic DNS entry using the client's\nIP address.\n\n\n\n############################################################\nTo-do\n\nThere are several possible improvements:\n\n- only change the dynamic DNS entry when the new IP address is\n  different from the existing one\n- differentiate between IPv4 and IPv6 addresses\n  right now the script only allows one address, either IPv4 or\n  IPv6\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreasscherbaum%2Fbind-dynamic-dns-update","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreasscherbaum%2Fbind-dynamic-dns-update","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreasscherbaum%2Fbind-dynamic-dns-update/lists"}