{"id":23278509,"url":"https://github.com/hdfgroup/dynamic-dns","last_synced_at":"2025-06-12T22:32:58.526Z","repository":{"id":66041898,"uuid":"49402026","full_name":"HDFGroup/dynamic-dns","owner":"HDFGroup","description":"A dynamic DNS server for mapping files to DNS entries ","archived":false,"fork":false,"pushed_at":"2016-07-12T04:37:44.000Z","size":9,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-12T18:32:14.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"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/HDFGroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2016-01-11T04:29:12.000Z","updated_at":"2022-01-30T09:10:11.000Z","dependencies_parsed_at":"2023-05-31T21:46:25.635Z","dependency_job_id":null,"html_url":"https://github.com/HDFGroup/dynamic-dns","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/HDFGroup%2Fdynamic-dns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HDFGroup%2Fdynamic-dns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HDFGroup%2Fdynamic-dns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HDFGroup%2Fdynamic-dns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HDFGroup","download_url":"https://codeload.github.com/HDFGroup/dynamic-dns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485281,"owners_count":20946397,"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-12-19T22:32:03.678Z","updated_at":"2025-04-06T12:42:25.362Z","avatar_url":"https://github.com/HDFGroup.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"********************\nDynamic DNS \n********************\n\nA simple dynamic DNS server server that returns the host IP address for any sub-domain.\nThis DNS server can optionally be used with the HDF Server (see https://github.com/HDFGroup/h5serv)  \nif you would like to display data from h5serv using a web browser without needing to specify a \"host\"\nquery parameter.  \n\nBackground\n-----------\n\nThe HDF5 REST api exposes each HDF5 file as a domain object.  E.g.\nIf the file \"hdf_data.h5\" is in the data directory, and the 'domain' config in server.py\nis set to \"mydata.myorg.org\", the file is mapped to the domain path: \n*hdf_data.mydata.myorg.org*.\n\nWhen the HDF REST Service is accessed programmatically, the http request can be sent \nto the endpoint where h5serv is running and dynamic_dns.py is not needed. In this case it is \nimportant that the request host header provide the domain path above.\n\nExample:\n\n.. code-block:: http\n\n    GET / HTTP/1.1\n    Host: hdf_data.myserv.myorg.org\n    \nThe service will look at the Host header line to determine which HDF5 file the ``GET /`` \nrequest refers to and return the appropriate response. \n\nHowever, if you type `http://hdf_data.mydata.myorg.org` in your favorite web browser you\nwill most likely get a DNS lookup failure.  These is because the DNS server your browser\nis talking to doesn't know how to resolve the domain name: `hdf_data.mydata.myorg.org`.  \nYou can verify this by running: `nslookup hdf_data.mydata.myorg.org`, you should see a response:\n`** server can't find hdf_data.mydata.myorg.org`.\n\nYou can imagine getting around this by configuring special DNS lookup rules for each \nHDF5 file managed by h5serv, but this would require a config update every time a new \nfile was created (say by a ``PUT /`` request).  \n\nThe DNS server in this repository, dynamic_dns.py, avoids this issue by simply\nresponding to any DNS request with the configured base domain name to the IP address of h5serv.\nAny request that doesn't map to the base domain name will be forwarded to a regular DNS\nserver.\n\nSo a request to resolve `hdf_data.myserv.myorg.org` would return the IP address of h5serv, \nwhile a request to resolve `www.google.com` would be forwarded to a standard DNS server.\n\nRunning dynamic_dns\n-------------------\n\nBefore starting the dynamic_dns server, update the local_ip, and default_dns config values \nin config.py to what makes sense for your network.  Using the above example, domain would \nbe myserv.myorg.org and local_ip can be left as just 127.0.0.1 if we are running h5serv and \ndynamic_dns on the same host.\n\nNext, start the dynamic_dns server: `sudo python dynamic_dns.py`\n\n*Note:* You will need to run as root since dynamic_dns using port 53 (the standard DNS port).\n\nNow when you run: `nslookup hdf_data.mydata.myorg.org 127.0.0.1`, you should see a response:\n\n`Non-authoritative answer:`\n\n`Name: hdf_data.mydata.myorg.org`\n\n`Address: 127.0.0.1`\n\ndynamic_dns has resolved the domain name hdf_data.mydata.myorg.org to the local ip address.\n\nIf at this point you modify your machine's dns configuration to use the IP address where\ndynamic_dns.py is running, you'll be able to use: hdf_data.mydata.myorg.org/ as a browser\nurl and see the JSON response.\n\nIntegrating with you organization's network\n-------------------------------------------\nIf you would like *any* computer to recognize the domain name of hdf_data.myserv.myorg.org\nyou will need to have your system admin update your organization's master DNS server to \nconfigure \"myserv\" as a zone of \"myorg\".  In our example, this would have the effect\nof any sub-domain of \"myserv.myorg\" managed by its own DNS server.  In our case, the DNS\nserver will be dynamic_dns.py.  Details of how zone's are setup will vary based on \nwhat DNS server software your network is running.  Your sysadmin should be able to help.\n\n \nAn Example\n----------\nAs an example of how this would work we can look at the h5serv instance setup by The HDF\nGroup.  Entering http://tall.data.hdfgroup.org:7253/ in your browser will return the JSON\ndomain response for tall.h5.  \n\nIf we trace the chain of events in displaying this page it\nwould be something like this (the actual IP address may be different than what you see here):\n\n 1. User enters `http://tall.data.hdfgroup.org:7253` in the browser\n 2. The browser sends the domain \"tall.data.hdfgroup.org\" to its normal DNS server\n 3. If the DNS server is not familiar with \"hdfgroup.org\" it forwards the request to the root domain server\n 4. The root domain server resolves \"hdfgroup.org\" the IP address 50.28.50.143\n 5. The HDFGroup DNS server at 50.28.50.143 gets the request to resolve \"data.hdfgroup.org\"\n 6. The HDF Group DNS server sees that \"data\" maps to a zone managed by the DNS server (dynamic_dns) at IP address 54.174.38.12\n 7. Finally, the dynamic_dns.py service gets the DNS request and resolves the name \"tall.data.hdfgroup.org\" and returns the IP address 54.174.38.12 and returns the requested IP to the browser\n 8. With the dns name resolved, the browser sends the original http request to port 7253 on the machine with IP address 54.174.38.12.\n 9. This request is processed by h5serv which returns a http status of 200 followed by the response body\n 10. The browser renders the response:\n \n \n```\n\n  {\n  root: \"345239f2-963f-11e4-b8cf-06fc179afd5e\",\n  created: \"2015-01-07T07:31:33.294348Z\",\n  lastModified: \"2015-01-07T07:31:33.294348Z\",\n  hrefs: [\n    {href: \"http://tall.data.hdfgroup.org:7253/\", rel: \"self\"},\n    {href: \"http://tall.data.hdfgroup.org:7253/datasets\", rel: \"database\"},\n    {href: \"http://tall.data.hdfgroup.org:7253/groups\", rel: \"groupbase\"},\n    {href: \"http://tall.data.hdfgroup.org:7253/datatypes\",rel: \"typebase\"},\n    {href: \"http://tall.data.hdfgroup.org:7253/groups/345239f2-963f-11e4-b8cf-06fc179afd5e\",rel: \"root\"}\n   ]\n  }\n```\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdfgroup%2Fdynamic-dns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhdfgroup%2Fdynamic-dns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdfgroup%2Fdynamic-dns/lists"}