Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/badboy/dnsoverhttps
dnsoverhttps - D'oh!
https://github.com/badboy/dnsoverhttps
Last synced: 9 days ago
JSON representation
dnsoverhttps - D'oh!
- Host: GitHub
- URL: https://github.com/badboy/dnsoverhttps
- Owner: badboy
- License: mit
- Created: 2018-02-06T19:25:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-20T22:12:16.000Z (over 6 years ago)
- Last Synced: 2024-12-24T02:01:14.558Z (12 days ago)
- Language: Rust
- Homepage:
- Size: 37.1 KB
- Stars: 14
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# dnsoverhttps - D'oh!
[![crates.io](http://meritbadge.herokuapp.com/dnsoverhttps)](https://crates.io/crates/dnsoverhttps)
Resolve hostnames by sending DNS queries over HTTPS.
It uses `https://1.1.1.1` as the DNS resolver by default, hosted by Cloudflare.
According to Cloudflare it is a privacy-first consumer DNS service.
See for more information.Based on .
## Drawbacks
* When specifing a URL, the hostname has to be specified as well for use in HTTP.
The TLS Certificate received from the server is validated, but not checked for the correct hostname..
* Only handles A and AAAA records for now (IPv4 & IPv6, this implicitely handles CNAMES when they are resolved recursively)## Example: Default resolver
```rust
let addr = dnsoverhttps::resolve_host("example.com");
```## Example: Custom resolver
```rust
let client = dnsoverhttps::Client::from_url_with_hostname("https://172.217.21.110/experimental", "dns.google.com".to_string()).unwrap();
let addr = client.resolve_host("example.com");
```## CLI Usage
`dnsoverhttps` comes with a small CLI utility providing `host` functionality to resolve hostnames:
```
$ host example.com
example.com has address 2606:2800:220:1:248:1893:25c8:1946
example.com has address 93.184.216.34
```To install:
```
cargo install dnsoverhttps
```## License
MIT. See [LICENSE](LICENSE).