Skip to content

Commit 30d5091

Browse files
committed
Make better README
1 parent 21ced1c commit 30d5091

File tree

2 files changed

+51
-23
lines changed

2 files changed

+51
-23
lines changed

LICENSE LICENSE.md

File renamed without changes.

README.md

+51-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Dealdoh
1+
# Dealdoh
2+
> Deal DNS over HTTPS
23
3-
Dealdoh is a simple DNS over HTTPS proxy to deal with DOH built with PHP.
4+
Dealdoh is a simple DNS over HTTPS proxy powered by PHP.
45

56
![PHP from Packagist](https://img.shields.io/packagist/php-v/noglitchyo/dealdoh.svg)
67
[![Build Status](https://travis-ci.org/noglitchyo/dealdoh.svg?branch=master)](https://travis-ci.org/noglitchyo/dealdoh)
@@ -10,42 +11,48 @@ Dealdoh is a simple DNS over HTTPS proxy to deal with DOH built with PHP.
1011

1112
Dealdoh go a little beyond what a simple proxy should do:
1213

13-
- [x] Can use multiple upstreams
14-
- [x] Can use different DNS protocol: standard udp/tcp, DoH
15-
- [x] Attempt to provide a DNS abstraction layer (from https://tools.ietf.org/html/rfc1035) to allow development on top of it and customization
14+
- [x] It can use multiple upstreams at once and provide a fallback mechanism.
15+
- [x] It can use different DNS protocol: RFC-1035 (TCP/UDP), RFC-8484 (DoH)
16+
- [x] Attempt to provide a DNS abstraction layer to allow easy development on top of it.
1617

1718
## Roadmap
1819

19-
- [ ] Add full unit test coverage
20-
- [ ] Improve current DNS clients
21-
- [ ] Ability to choose a DNS upstream strategy
22-
- [ ] Dockerized app
20+
- [ ] Improve the current DNS clients
21+
- [ ] Add Google DOH API client (https://developers.google.com/speed/public-dns/docs/dns-over-https)
22+
- [ ] Ability to choose a DNS upstream fallback/selection strategy
23+
- [ ] Dockerized application
2324
- [ ] Good documentation
2425

2526
## Why Dealdoh?
2627

27-
Dealdoh was created for development purpose: I wanted to reach my Docker containers from the browser by their hostnames.
28-
But let's give some context:
28+
Dealdoh was created for development purpose. I wanted to reach my Docker containers from the browser by their hostnames.
29+
So I started to use a [Docker image who discover services and register their hostname into a DNS](https://github.com/mageddo/dns-proxy-server) exposed on port 53.
30+
But I encountered the following issues:
2931
- I could not change the /etc/hosts file
30-
- I could not change the DNS for the machine
31-
- My Docker container domain names were well registered in a custom DNS docker container (thanks to: https://github.com/mageddo/dns-proxy-server)
32-
So, I ended up with the following solution: use the DOH client from Mozilla Firefox and proxy every DNS query to Dealdoh.
33-
32+
- I could not change the DNS for my computer (restrictions issue)
33+
34+
I ended up with the following solution: use the DoH client from Firefox and proxy every DNS query to a DoH proxy: Dealdoh.
3435

3536
## Getting started
3637

38+
### Requirements
39+
40+
- A web server
41+
- HTTPS enabled (self-signed certificates can do depending on the DOH client)
42+
3743
### Installation
3844

39-
- Install dependencies
40-
`composer require noglitchyo/dealdoh`
45+
- `composer require noglitchyo/dealdoh`
4146

42-
- You need a PSR-7 ServerRequest if you wish to directly use the `HttpProxy::forward()` method. Please check some cool implementations below:
47+
- You need a PSR-7 ServerRequest if you wish to directly use the `HttpProxy::forward()` method.
48+
Please check those cool implementations below:
4349
* https://github.com/Nyholm/psr7 - `composer require nyholm/psr7`
4450
* https://github.com/guzzle/psr7 - `composer require guzzle/psr7`
4551
* https://github.com/zendframework/zend-diactoros - `composer require zendframework/zend-diactoros`
4652

47-
- Configure your entrypoint
48-
As stated before, `HttpProxy::forward()` method consumes PSR-7 ServerRequest to make it easier to implement on "Action" or "Middleware" classes.
53+
- Configure your dealdoh entrypoint
54+
55+
As stated before, `HttpProxy::forward()` method consumes PSR-7 ServerRequest to make it easier to implement on "Action"/"Middleware" classes.
4956
The example below illustrate how to use two different DNS upstreams using different protocols.
5057
Two types of DNS client who can handle each of the DNS protocols used by our upstreams are also injected.
5158

@@ -77,16 +84,37 @@ $dnsProxy = new \NoGlitchYo\Dealdoh\HttpProxy(
7784
/** @var \Psr\Http\Message\ResponseInterface */
7885
$response = $dnsProxy->forward($request);
7986
```
87+
- Testing the installation
88+
89+
First, you need to know that most of implemented DoH client/server will send/receive DNS requests on the following path:
90+
`/dns-query`. Make sure your Dealdoh proxy has been configured to listen on this route or configure the client accordingly.
91+
92+
Multiple options exists:
93+
94+
* Using the doh-client from [Facebook Experimental](https://github.com/facebookexperimental/doh-proxy)
95+
96+
To make it easier, I created a [Docker image](https://hub.docker.com/) that you can use by running:
97+
98+
`docker run --name dohfb -it noglitchyo/facebookexperimental-doh-proxy doh-client --domain dealdoh.proxy.addr --qname whatismyip.com --dnssec --insecure`
99+
100+
(Tips: pass the --insecure option to doh-client if you are using self-signed certificates **#notDocumented**)
101+
Please, check [how to use the client](https://github.com/facebookexperimental/doh-proxy#doh-client).
102+
103+
* Using your client browser
104+
105+
Firefox provides a [Trusted Recursive Resolver](https://wiki.mozilla.org/Trusted_Recursive_Resolver) who can be configured to query DoH servers.
106+
I advise you to read [this really good article from Daniel Stenberg](https://daniel.haxx.se/blog/2018/06/03/inside-firefoxs-doh-engine/) which will give you lot of details about this TRR and how to configure lik a pro.
80107

81108
## License
82109

83110
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
84111

85112
## Acknowledgments
86113

87-
* Thanks to https://github.com/reactphp/dns for their really good DNS wire format codec
88-
* Thanks to https://github.com/mageddo/dns-proxy-server for its amazing container hostname discovery & DNS image
89-
* Thanks to https://github.com/facebookexperimental/doh-proxy, because their doh-client rocks!
114+
* https://github.com/reactphp/dns for their really good DNS wire format codec.
115+
* https://github.com/mageddo/dns-proxy-server for its amazing container hostname discovery & DNS Docker image.
116+
Combined with Dealdoh it is amazing.
117+
* https://github.com/facebookexperimental/doh-proxy, because their doh-client rocks!
90118

91119
## References
92120

0 commit comments

Comments
 (0)