{"id":18458517,"url":"https://github.com/relaycorp/doh-jvm","last_synced_at":"2025-10-19T00:23:55.883Z","repository":{"id":37985153,"uuid":"324588044","full_name":"relaycorp/doh-jvm","owner":"relaycorp","description":"Basic DNS-over-HTTPS library for the JVM","archived":false,"fork":false,"pushed_at":"2024-04-15T03:27:55.000Z","size":1172,"stargazers_count":9,"open_issues_count":9,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-17T02:31:44.618Z","etag":null,"topics":["android","dns-over-https","doh","java","jvm","kotlin"],"latest_commit_sha":null,"homepage":"https://central.sonatype.com/search?q=doh\u0026namespace=tech.relaycorp","language":"Kotlin","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/relaycorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2020-12-26T15:57:47.000Z","updated_at":"2024-05-13T04:24:04.883Z","dependencies_parsed_at":"2023-02-10T00:46:06.215Z","dependency_job_id":"1be67024-8c42-4343-a29e-b019a5211a2d","html_url":"https://github.com/relaycorp/doh-jvm","commit_stats":null,"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relaycorp%2Fdoh-jvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relaycorp%2Fdoh-jvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relaycorp%2Fdoh-jvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relaycorp%2Fdoh-jvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/relaycorp","download_url":"https://codeload.github.com/relaycorp/doh-jvm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785919,"owners_count":20995641,"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":["android","dns-over-https","doh","java","jvm","kotlin"],"created_at":"2024-11-06T08:18:59.618Z","updated_at":"2025-10-19T00:23:50.845Z","avatar_url":"https://github.com/relaycorp.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DNS-over-HTTPS (DoH) client for the JVM and Android\n\nThis library implements a DNS-over-HTTPS (DoH) client for the JVM 8+ and Android 5+. By default, it connects to Cloudflare's DoH resolver, but any RFC 8484-compliant resolver can be used.\n\nBehind the scenes, this client uses OkHTTP via KTor in order to get coroutine support and keep a connection pool.\n\nFor privacy reasons, HTTP requests are made with the POST method, but we'd welcome a PR to support GET requests optionally.\n\nFor security reasons, DNSSEC validation can't be turned off, but we're open to consider toggling DNSSEC validation if there's a good reason to do so and a PR is subsequently proposed.\n\n## Install\n\nYou can get this library from [Maven Central](https://search.maven.org/artifact/tech.relaycorp/doh).\n\n## Usage\n\nThe client has a very simple interface. For example, to resolve the `A` record(s) for `example.com`, you'd just do:\n\n```kotlin\nvar aRecords : List\u003cString\u003e? = null\nval doh = DoHClient()\ndoh.use {\n    aRecords = doh.lookUp(\"example.com\", \"A\").data\n}\n```\n\nMake sure to wrap your code around `.use { ... }` or call `.close()` after using the client in order to release the underlying resources.\n\nIf you don't wish to use the default resolver (Cloudflare), pass the DoH resolver URL to the constructor of `DoHClient`.\n\n[Read the API documentation online](https://docs.relaycorp.tech/doh-jvm).\n\n## Comparison with other JVM DoH clients\n\n- [`org.xbill.DNS.DohResolver`](https://javadoc.io/doc/dnsjava/dnsjava/latest/org/xbill/DNS/DohResolver.html) is a proof-of-concept implementation with documented shortcomings that make it unsuitable for production environments.\n- [`dohjava`](https://github.com/NUMtechnology/dohjava) is undocumented, seemed abandoned, and a cursory code review uncovered issues such as:\n  - It creates a single-use, blocking HTTP client.\n  - It only supports GET requests, which makes responses cacheable, but is [bad for privacy](https://developers.google.com/speed/public-dns/docs/doh#privacy_best_practices).\n- [`okhttp3.dnsoverhttps.DnsOverHttps`](https://square.github.io/okhttp/3.x/okhttp-dnsoverhttps/okhttp3/dnsoverhttps/DnsOverHttps.html) only supports `A`/`AAAA` records because it appears to be only meant to be used with OkHTTP.\n\n## Contributing\n\nWe love contributions! If you haven't contributed to a Relaycorp project before, please take a minute to [read our guidelines](https://github.com/relaycorp/.github/blob/master/CONTRIBUTING.md) first.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelaycorp%2Fdoh-jvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frelaycorp%2Fdoh-jvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelaycorp%2Fdoh-jvm/lists"}