An open API service indexing awesome lists of open source software.

https://github.com/ssrlive/dns-over-https

A lightweight DNS-over-HTTPS ("DOH") proxy written in Rust.
https://github.com/ssrlive/dns-over-https

dns dns-over-https dns-over-tls doh dot https tls

Last synced: 6 months ago
JSON representation

A lightweight DNS-over-HTTPS ("DOH") proxy written in Rust.

Awesome Lists containing this project

README

          

# DNS-over-HTTPS

[![Crates.io](https://img.shields.io/crates/v/dns-over-https.svg)](https://crates.io/crates/dns-over-https)
![dns-over-https](https://docs.rs/dns-over-https/badge.svg)
[![Documentation](https://img.shields.io/badge/docs-release-brightgreen.svg?style=flat)](https://docs.rs/dns-over-https)
[![Download](https://img.shields.io/crates/d/dns-over-https.svg)](https://crates.io/crates/dns-over-https)
[![License](https://img.shields.io/crates/l/dns-over-https.svg?style=flat)](https://github.com/ssrlive/dns-over-https/blob/master/LICENSE)

A lightweight DNS-over-HTTPS ("DOH") proxy written in Rust.

DNS-over-HTTPS is a lightweight proxy that will securely forward any requests to a DNS-over-HTTPS resolver such as [Cloudflare](https://developers.cloudflare.com/1.1.1.1/dns-over-https/).

**Current version:** 0.2.0
**Supported Rust version:** 1.31

## Install

Download the latest binary for your architecture from the [releases page](https://github.com/ssrlive/dns-over-https/releases).

## Usage

```
Usage: dns-over-https [OPTIONS]

Options:
-b, --bind Listen for DNS requests on the addresses and ports [default: 127.0.0.1:53]
-u, --upstream-urls URL(s) of upstream DNS-over-HTTPS service [default: https://1.1.1.1/dns-query]
-v, --verbosity Verbosity level [default: info] [possible values: off, error, warn, info, debug, trace]
--service Windows only: Run as a service
-h, --help Print help
-V, --version Print version
```

### Running on Windows

To use DNS-over-HTTPS to encrypt your DNS requests on Windows, download and install the latest [release](https://github.com/ssrlive/dns-over-https/releases).

Or you can install it using `cargo`, assuming you have `Rust` installed:

```bash
cargo install dns-over-https
```
The binary will be installed in `C:\Users\\.cargo\bin\dns-over-https.exe`.

Open a `powershell` terminal with administrative privileges and input command `New-Service` to create a new service,
- Name: `dns-over-https`
- BinaryPathName: `C:\Users\\.cargo\bin\dns-over-https.exe -b 127.0.0.1:53 -b [::1]:53 --service`

![image](https://github.com/ssrlive/dns-over-https/assets/30760636/284e1063-179b-4ee9-8f85-1124769eb318)

Start the service: Input command `services` from start menu, open `Services` window, start the service `dns-over-https`.

![image](https://github.com/ssrlive/dns-over-https/assets/30760636/a66a038d-cc26-4b97-a762-977ff806e969)

Modify the DNS server address in the network adapter settings to `127.0.0.1`(IPv4) and `::1`(IPv6).

![image](https://github.com/ssrlive/dns-over-https/assets/30760636/25505389-ff61-44e7-88b1-6117eb36c66c)

Done.

### Running on a Pi-Hole

To use DNS-over-HTTPS to encrypt your DNS requests on a Pi-Hole, download and install the latest [release](https://github.com/ssrlive/dns-over-https/releases):

```bash
pi@raspberrypi:~ $ wget https://github.com/ssrlive/dns-over-https/releases/latest/download/dns-over-https-arm-unknown-linux-gnueabihf.zip
pi@raspberrypi:~ $ unzip dns-over-https-arm-unknown-linux-gnueabihf.zip
pi@raspberrypi:~ $ sudo mv dns-over-https /usr/local/bin/
```

You can confirm dns-over-https is working properly by asking for the current version:

```bash
pi@raspberrypi:~ $ dns-over-https --version
dns-over-https 0.2.0
```

You can then configure dns-over-https to run as a Systemd service that listens on port 5053 and forwards requests to [Cloudflare's DNS-over-HTTPS resolvers](https://developers.cloudflare.com/1.1.1.1/dns-over-https/).

First, create a system user for dns-over-https:

```bash
pi@raspberrypi:~ $ sudo adduser --system --no-create-home dns-over-https
```

Then write out a Systemd unit file:

```bash
pi@raspberrypi:~ $ sudo tee /lib/systemd/system/dns-over-https.service <