{"id":21145349,"url":"https://github.com/jsa2/azdyndns","last_synced_at":"2026-06-15T21:32:22.970Z","repository":{"id":103264263,"uuid":"317153040","full_name":"jsa2/azdyndns","owner":"jsa2","description":"Dyndns for a dime ","archived":false,"fork":false,"pushed_at":"2020-11-30T10:49:16.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T13:43:09.549Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsa2.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-30T08:09:49.000Z","updated_at":"2020-11-30T10:49:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce6e9587-f467-47fa-a14b-49f0e9e3fb9c","html_url":"https://github.com/jsa2/azdyndns","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jsa2/azdyndns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsa2%2Fazdyndns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsa2%2Fazdyndns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsa2%2Fazdyndns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsa2%2Fazdyndns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsa2","download_url":"https://codeload.github.com/jsa2/azdyndns/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsa2%2Fazdyndns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34381759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"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":[],"created_at":"2024-11-20T08:39:39.565Z","updated_at":"2026-06-15T21:32:22.947Z","avatar_url":"https://github.com/jsa2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dyndns for a dime 0.1\n- Create dyndns endpoint which updates Azure DNS based on the callers Public IP address which is seen on the function side\n    - Typical use case would be a having raspberry PI curl the endpoint as scheduled task \n- The caller is authorized by the function key \n![img](mdpics/keys.png)\n- Almost all basic HTTP clients and browsers should work\n![img](mdpics/update.png)\n\n# Other\n- This guide is not comprehensive and code was created for minimum viable testing (configs missing etc) \n    - it highlights the critical parts of the deployment, but  leaves open the deployment methods, and setting up the runtime environment\n    - Easiest way (likely) is to deploy the code VScode\n- This is not the first time dyndns has been done on Azure. Looking for something stable you might to go elsewhere :)... \n- The code does barely any error handling. If something is wrong it will timeout, or throw some of the errors in a promise rejection\n\n# requirements\n- Functions runtime on extensions, and functions runtime including NodeJS installed on the desktop you are planning to deploy from \n- SPN for local testing\n- Azure Function (Consumption, Windows App Service)\n- NodeJS runtime 12\n-   Enable the function for managed identity\n- DNS zone in Azure\n    - add the SPN and MSI as DNS contributor to the single record (not the whole zone) which you want to be the updated record\n    - update index.js to match the DNS resource \n    ```javascript\n    var uri = \"https://management.azure.com/subscriptions/mySUBID/resourceGroups/myRG/providers/Microsoft.Network/dnszones/dewi.red/A/dyn?api-version=2018-05-01\"\n    ```\n\n![img](mdpics/azdns.png)\n\n# local testing \ncreate client.json file in the function folder\n\n![img](mdpics/client.png)\n```json\n{\n    \"grant_type\":\"client_credentials\",\n    \"client_id\":\"4d102cc5-d0ff-420a-b34f-e8503280f3c1\",\n    \"client_secret\":\"mysecret\",\n    \"resource\":\"https://management.azure.com\"\n}\n```\nrun func host start --javascript\n\ncall function locally \n```\nInvoke-RestMethod  http://localhost:7071/api/dyndnsfunc -Headers @{'x-forwarded-for'=\"1.2.2.4:54466\"}\n```\n\n# Expected results\nif all checks out: \n- the SPN and MSI is given permission for the DNS zone, and correct app service plan (windows in this case, as I had trouble with Linux App Service and MSI this )\nThis is what you should see on updates\n```powershell\n# Azure DNS zone and the NS record here\nnslookup dyn.dewi.red ns1-07.azure-dns.com\n$apiver = \"api-version=2019-08-01\"\n$resource = \"https://management.azure.com\"\n$code = \"myfunctioncode\"\n$uri =\"https://azdynd.azurewebsites.net/api/dyndnsfunc?code=$code\u0026resource=$resource\u0026api=$apiver\";\n$sd = Invoke-RestMethod -UseBasicParsing $uri\n$sd\nstart-sleep -Seconds 2\nnslookup dyn.dewi.red ns1-07.azure-dns.com\n$sd\n```\nUpon complete deployment you should see following update on response, and the NSLookup reflect the record \n```nslookup dyn.dewi.red ns1-07.azure-dns.com```\n\n![img](mdpics/dns.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsa2%2Fazdyndns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsa2%2Fazdyndns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsa2%2Fazdyndns/lists"}