{"id":16883402,"url":"https://github.com/hardillb/dns-over-https","last_synced_at":"2025-04-11T11:51:43.749Z","repository":{"id":44032067,"uuid":"129555033","full_name":"hardillb/dns-over-https","owner":"hardillb","description":"A quick and dirty implmentation of DNS-Over-HTTP","archived":false,"fork":false,"pushed_at":"2024-12-06T12:04:41.000Z","size":302,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T08:11:14.548Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hardillb.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":["hardillb"]}},"created_at":"2018-04-14T21:15:42.000Z","updated_at":"2024-12-06T12:04:39.000Z","dependencies_parsed_at":"2023-01-24T14:00:45.631Z","dependency_job_id":"a536d498-844a-40fe-be65-6657b6023ec1","html_url":"https://github.com/hardillb/dns-over-https","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/hardillb%2Fdns-over-https","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardillb%2Fdns-over-https/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardillb%2Fdns-over-https/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardillb%2Fdns-over-https/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hardillb","download_url":"https://codeload.github.com/hardillb/dns-over-https/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248390489,"owners_count":21095806,"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-10-13T16:11:34.778Z","updated_at":"2025-04-11T11:51:43.725Z","avatar_url":"https://github.com/hardillb.png","language":"JavaScript","funding_links":["https://github.com/sponsors/hardillb"],"categories":[],"sub_categories":[],"readme":"# A Basic DNS-Over-HTTPS implementation\n\nFollowing the anouncement from Mozilla, Cloudflare and Google and starting a trial of DNS-Over-HTTPS I thought it might be useful \nto look at how to implement my own server.\n\nAt the moment there are 2 competing standards.\n\n### JSON\n\nThe spec for the Google implementation can be found [here](https://developers.google.com/speed/public-dns/docs/dns-over-https).\n\n### Wireformat\n\nThe RFC for this is available [here](https://datatracker.ietf.org/doc/draft-ietf-doh-dns-over-https/?include_text=1)\n\n## Running\n\n### HTTPS-to-DNS proxy\n\nThis lets you offer DNS-over-HTTPS for your own DNS server.\n\nFirst you need to SSL certificate for your server because the broker will only request DNS lookups from a secure server. Normally I'd go \nwith Letsencrypt but unfortunately they won't issue a certificate for a raw IP address.\n\nIf you don't want to pay for a \"real\" certificate I've included a script to build a self signed for the IP address you are going to run this on.\n\n`./mkCert.sh 192.168.1.1`\n\nYou will be asked for a password 3 times, this will not be needed again but needs to match all 3 times.\n\nTo run on the default port 443 and query the Google 8.8.8.8 DNS server then use the following:\n\n`node https-to-dns-proxy.js`\n\nYou can change the DNS server to query by passing it on the command line:\n\n`node https-to-dns-proxy.js 192.168.1.1`\n\nOnce running point `https://\u003cip-address\u003e/test` and accept the security exception to import and trust the certificate.\n\n### Configuring Firefox (version 60 or newer)\n\n+ Enter `about:config` in the address bar\n+ search for `network.trr`\n+ change `network.trr.mode` to either 1, 2 or 3. \n    - 1 Firefox pick the quickest\n    - 2 Firefox trys DNS-Over-HTTPS first and falls back to DNS\n    - 3 Firefox only uses DNS-Over-HTTPS\n+ change `network.trr.uri` to `https://\u003cip-address\u003e/query`\n+ change `network.trr.bootstrapAddress` to `\u003cip-address\u003e`\n\n### DNS-to-HTTPS proxy\n\nThis lets you proxy normal DNS queries to a DNS-over-HTTPS enabled server.\n\nBy default this will try to bind to port 53 which will require admin level access. On Linux you can get with with sudo.\n\n`sudo node dns-to-https-proxy`\n\nYou can change the port it binds to by setting the `DNS_PORT` environment variable\n\n - DNS_PORT used to set the port\n - DNS_URL used to set the URL for the DNS-over-HTTPS endpoint\n - DNS_INSECURE used for testing to allow untrusted certificates for the DNS_URL\n\n## TODO\n\n- ~~Add HTTP/2 support~~\n- More testing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardillb%2Fdns-over-https","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhardillb%2Fdns-over-https","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardillb%2Fdns-over-https/lists"}