{"id":18907194,"url":"https://github.com/42atomys/dns-updater","last_synced_at":"2025-08-04T07:10:25.512Z","repository":{"id":104032660,"uuid":"453383598","full_name":"42atomys/dns-updater","owner":"42atomys","description":"Simple go app how update dns A and AAAA entry on each IP update (awesome for lab or server with dynamic ip)","archived":false,"fork":false,"pushed_at":"2023-01-07T15:52:13.000Z","size":78,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T05:51:28.509Z","etag":null,"topics":["dns","docker-image","golang","homelab","kubernetes","simple-app"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/42atomys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["42Atomys"]}},"created_at":"2022-01-29T11:53:55.000Z","updated_at":"2025-02-18T01:19:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"7a234695-c364-49af-b729-af373a8d1a3c","html_url":"https://github.com/42atomys/dns-updater","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/42atomys/dns-updater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42atomys%2Fdns-updater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42atomys%2Fdns-updater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42atomys%2Fdns-updater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42atomys%2Fdns-updater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/42atomys","download_url":"https://codeload.github.com/42atomys/dns-updater/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42atomys%2Fdns-updater/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268660142,"owners_count":24286028,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","docker-image","golang","homelab","kubernetes","simple-app"],"created_at":"2024-11-08T09:20:02.637Z","updated_at":"2025-08-04T07:10:25.484Z","avatar_url":"https://github.com/42atomys.png","language":"Go","funding_links":["https://github.com/sponsors/42Atomys"],"categories":[],"sub_categories":[],"readme":"# DNS-Updater\n\n[![Release 🎉](https://github.com/42Atomys/dns-updater/actions/workflows/release.yaml/badge.svg)](https://github.com/42Atomys/dns-updater/actions/workflows/release.yaml)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/42atomys/dns-updater?label=last%20release)\n![GitHub contributors](https://img.shields.io/github/contributors/42Atomys/dns-updater?color=blueviolet)\n![GitHub Repo stars](https://img.shields.io/github/stars/42atomys/dns-updater?color=blueviolet)\n[![Docker Pull](https://img.shields.io/docker/pulls/atomys/dns-updater)](https://hub.docker.com/r/atomys/dns-updater)\n[![Docker Pull](https://img.shields.io/docker/image-size/atomys/dns-updater)](https://hub.docker.com/r/atomys/dns-updater)\n\nSimple application in Golang that retrieves your ip and updates your DNS entries automatically each time your IP changes.\n\n## Motivation\n\nHaving a lab at home. behind an ip which is dynamic, I could not keep a static DNS entry, since at each change of IP I have to change the DNS entries of all my domains.\n\nSo I wrote this little program one afternoon in order to get rid of this manual task which, when it occurred when I was not at home, was very annoying, imagine you can no longer watch plex while you are with your date. Unthinkable\n\n## Usage\n\nTo use it, its really simple (3 steps)\n\nYou can use official Docker image : `atomys/dns-updater` (https://hub.docker.com/r/atomys/dns-updater) to test it or install it un your servers or Kubernetes Clusters. You can found an example to deploy this program on a Kubernetes cluster on the `examples/kubernetes` folder.\n\n### Step 1 : Configure your updater.yaml\nIn config folder, edit the updater.yaml\n\n```yaml\n# Interval at which the program will check if your IP has changed\nipFetchInterval: 30s\n\n# Records entries define the rules to follow when found an ip change\nentries:\n- #  name of the provider to use. Must be registered\n  provider: ovh\n  # domain to update\n  domain: example.space\n  # when your record is on a subdomain enter the name of\n  # the sub domain here without domain extension\n  # `awesome.example.space` must be `awesome`\n  subDomain: null\n  # Type of the record. Actually must be A or AAAA only\n  type: A\n```\n\n### Step 2: Launch it\n```\n$ ./dns-updater\n```\n\n### Step 3: Configure provider authentication data through env\n\n| Provider Name | Provider Site         | Environment Variables                                                                                                                                |\n| ------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `ovh`         | https://ovh.com       | `OVH_APPLICATION_KEY` Your OVH Application Key\u003cbr /\u003e `OVH_APPLICATION_SECRET` Your OVH Apllication Secret\u003cbr /\u003e `OVH_CONSUMER_KEY` Your Consumer Key |\n| `gandi`       | https://www.gandi.net | `GANDI_APPLICATION_KEY` Your Gandi API key (https://account.gandi.net)                                                                               |\n|               |                       |                                                                                                                                                      |\n\n# Contribution\n\nAll pull requests and issues on GitHub will welcome.\n\n## How to add provider \n\nA provider must be have two function\n```go\n/**\n * Definition of a Provider interface\n * Used to implement any DNS service to make it compatible for DNS Updater\n *\n * Name()       =\u003e  Return the name of the provider. Must be unique\n * UpdateDNS()  =\u003e  Method called when an IP changes is detected and used to update\n *                  DNS Entry on Provider\n */\ntype Provider interface {\n\t// Return the name of the provider. Must be unique\n\tName() string\n\t// Method called when an IP changes is detected and used to update\n\t// DNS Entry on Provider\n\tUpdateDNS(domainName, subDomain string, fieldType dns.RecordType, ip net.IP) error\n}\n```\n\n### Add a provider (built-in method)\nWant to use this program but your DNS provider is not integrated? You can participate by creating your provider and a merge request\n\nTo add a new provider go to `pkg/providers` package and create a new file named by the name of DNS provider.\n\nAfter that, Register the new Provider on `pkg/manager/providers.go` file on the `Registration Section`\nand add your new built-in provider in the switch case\n```go\n\tcase \"awesome\":\n\t\trecord.Provider = providers.NewAwesomeProvider()\n```\n\n### Add a provider (runtime method)\nIn some specific case, like custom dns server or custom dns service, private internal dns or somethings like that, \nyou can't add this provider to the main repository. \n\nIn this specific case, you can add a custom provider to your app and use the manager.\n\nThis is an example of custom dns-updater \n```go\npackage main\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"github.com/rs/zerolog/log\"\n\t\"gitlab.com/atomys-universe/dns-updater/internal/pkg/dns\"\n\t\"gitlab.com/atomys-universe/dns-updater/pkg/manager\"\n)\n\ntype NinjaProvider struct{}\n\nfunc (p NinjaProvider) Name() string {\n\treturn \"ninja\"\n}\n\nfunc (p NinjaProvider) UpdateDNS(domainName, subDomain string, fieldType dns.RecordType, ip net.IP) error {\n\t// Do update stuff\n\treturn nil\n}\n\nfunc main() {\n\t// Register your private Custom Provider before validate\n\t// the configuration\n\tmanager.RegisterCustomProvider(NinjaProvider{})\n\t// Validate the configuration\n\tif err := manager.ValidateConfiguration(); err != nil {\n\t\tlog.Fatal().Err(err).Msg(\"configuration is invalid\")\n\t}\n\t// Start the manager\n\tgo manager.Run()\n\t// Some log\n\tlog.Info().Msg(\"DNS Updater is running\")\n\t// Ctrl+C catch\n\tc := make(chan os.Signal, 2)\n\tsignal.Notify(c, os.Interrupt, syscall.SIGTERM)\n\n\tdefer func() {\n\t\tlog.Info().Msg(\"Stoping DNS Updater...\")\n\t}()\n\n\t\u003c-c\n}\n```\nYou can now use `ninja` as provider in your configuration file ! 🎉\n\nAll contributions are welcome :)\n\n## Thanks\nThanks to ipconfig.co to provide simple curl service to know our ip","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42atomys%2Fdns-updater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F42atomys%2Fdns-updater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42atomys%2Fdns-updater/lists"}