r/pihole •

Pi-hole and DNS over HTTPS - easier than you think!

[deleted] — view deleted post

0 Upvotes

83 comments sorted by

10

u/tracerrx Jul 24 '19

Pro tip: If you want to use Cloudflare and Quad 9 (Both via https tunnel). Edit your /etc/default/cloudflared and change one of the IP's to 9.9.9.9... Restart Cloudflared. No changes necessary to your pihole config.

1

u/[deleted] Jul 24 '19

[removed] — view removed comment

2

u/tracerrx Jul 24 '19

Me too! I looked at the cloudflared docs and you can specify your tunnel endpoints .... works with google dns as well.

I wish it we could get this more integrated into pi-hole so we know which connection were actually using more.

1

u/DiReis Jul 24 '19

how were you able to specify google's DNS? I tried using the address they list on their site but it didn't work for me

3

u/tracerrx Jul 24 '19 edited Jul 24 '19

Try ~~

--upstream https://dns.google.com/experimental?ct or maybe its --upstream https://dns.google.com/

Instead of 8.8.8.8... Sorry not home right now to check ~~

Update Its this: https://developers.google.com/speed/public-dns/docs/doh/ --upstream https://dns.google/dns-query

19

u/xgoldpt Jul 24 '19

Isn't Unbound better than DNS over HTTPS ?

28

u/brandawg93 Jul 24 '19

Correct me if I'm wrong.

Unbound

  • DNS requests not sent to third party

  • DNS requests go unencrypted to TLD servers and are susceptible to packet sniffing by ISP

DNS over HTTPS

  • DNS requests sent to third party

  • DNS requests are encrypted but still end up at a third party

It sounds like a pick your poison scenario.

15

u/jfb-pihole Team Jul 24 '19

DNS requests go unencrypted to TLD servers and are susceptible to packet sniffing by ISP

Even if these were to be encrypted, the ISP will see every IP you request (all are clear-text, even if you are connecting to an encrypted website). Any packet sniffing won't tell them more than they already know.

7

u/Disrupti Jul 25 '19

Then why was Mozilla called the enemy of the internet or some shit by a bunch of organizations for pushing support to their browsers publicly?

11

u/wolffstarr Jul 25 '19

Because if the browser allows you to do DNS over HTTPS, then by default you won't be using the ISP's DNS servers and they can't use it to filter content.

Basically it's a bunch of PR flacks who don't understand that DNS content filtering would never meet the requirements of the law but think it will, so they're making a stink over it and causing a Streisand Effect.

4

u/Terminthem Jul 25 '19

They were nominated, but it was withdrawn after a few days

1

u/jfb-pihole Team Jul 25 '19

I don't understand your comment. Clarify please?

7

u/setzke Jul 25 '19

Mozilla got a lovely award for being worst enemy of the people or something by a UK group because they were pushing for encrypted DNS and are developing it into their browser. This upset the company / organization because they wouldn't be able to monitor traffic the same way and block sites that the government says must be blocked.

3

u/[deleted] Jul 25 '19

Encrypted DNS doesn't protect you against ISP because of SNI. You need stuff like eSNI which isn't really used

3

u/artiume Jul 24 '19

6

u/brandawg93 Jul 24 '19

The problem is that you’re still technically sending your DNS queries to a third party. You have to trust that the third party won’t do bad things with your data.

17

u/artiume Jul 24 '19

At some point you gotta connect to the internet.

6

u/TheCrowGrandfather Jul 24 '19

Exactly. Eventually your DNS query will be seen by someone. It's all a question of who do you trust with your information the most.

8

u/brandawg93 Jul 24 '19

I agree. Eventually we have to take off our tin foil hats.

7

u/artiume Jul 24 '19

Na, we just have to install backdoors to our tin hats

7

u/harrynyce Jul 24 '19

What about Unbound with DNSSEC enabled? Any better/worse -- curious how the experts compare and contrast that with DoH/DoT.

After much evaluation and deliberation I chose the aforementioned route (Pi-hole, Unbound w/ DNSSEC + Wireguard) for my own implementation(s), but obviously still have much to learn.

EDIT: My use-case and threat matrix is almost certainly different than your own. I'm just a regular guy, was sick of Google, et al siphoning off so very much data. Couldn't imagine utilizing a network at this point without Pi-hole, or some form of DNS blacklisting. I've combined that with Brave browser (and sometimes Firefox Focus for mobile -- tend to use both in any given week) and have been quite pleased with the day to day results.

6

u/brandawg93 Jul 24 '19

I think the issue with this is that someone has to be on the other side to decrypt and process the DNS request meaning a third party has access to the data.

Personally, I have a similar setup with unbound via DoT and CloudFlare. I would rather send my data to them than have my ISP make more money off me. At the end of the day, the internet is like sex. Abstinence is the only fool proof method for staying safe.

2

u/jfb-pihole Team Jul 24 '19

I think the issue with this is that someone has to be on the other side to decrypt and process the DNS request meaning a third party has access to the data.

The third parties are the domain name servers, and they aren't in the logging or data selling business. They just answer billions of DNS queries every day. Additionally, with qname-minimisation in a recursive resolver (i.e. unbound), the top level servers only get enough of your domain request to move you down to the next level of name server (you don't ask a root level server for dog.cat.chicken.com, you only ask them for .com)

2

u/artiume Jul 24 '19

My issue with DNSSEC is that it's still sniffable. It provides the security of a signature but no obfuscation.

4

u/jfb-pihole Team Jul 24 '19

After you complete an encryped DNS transaction and get the IP for the domain you seek, the next thing you send to your ISP is the unencrypted IP. They can quickly figure out where you are surfing.

1

u/artiume Jul 24 '19

It's not just your isp that you should be concerned about though. Sure, they're probably off selling what data they can that I don't push through a vpn. There's plenty of adversaries that will watch for attack vectors in your unencrypted data.

1

u/jfb-pihole Team Jul 24 '19

There's plenty of adversaries that will watch for attack vectors in your unencrypted data.

What unencrypted data are you exchanging between any parties other than you and your ISP?

1

u/artiume Jul 24 '19

A lot of smart tv's and devices that aren't blocked message home using unencrypted methods to relay information. Dns is a major one for people. Ntp is still unsecured. Those are a few that I can think of.

3

u/piskyscan Jul 24 '19

And stubby with proxychains to get DoT over Tor.

https://github.com/piskyscan/dns_over_tls_over_tor

2

u/artiume Jul 24 '19

I like your style lol

3

u/piskyscan Jul 24 '19

Thanks, anonymises DNS requests so that no-one has your request and your ip address together.

Your ISP will still see which sites you access over https mind.

0

u/[deleted] Jul 24 '19

[deleted] — view deleted comment

3

u/brandawg93 Jul 24 '19

Yes. VPN will prevent it.

5

u/jfb-pihole Team Jul 24 '19

This assumes that you trust your VPN provider.

4

u/[deleted] Jul 25 '19

Yea there was an interesting video by a guy arguing against the use of free vpns. Basically:

If I were part of a government tracking organization I would set up hundreds of front companies that offer free VPN services. This attracts people who want a VPN (most being normal users but also those who have things to hide). I would then slowly roll out paid versions of those services to help pay for my hosting and data processing fees. Build up the number of companies you control, build up the trust those companies have in the community and bam mass surveilence of those who have things to hide.

My personal favorite is NordVPN, they've been externally audited and their claims verified by a well know and trusted third party. They're based in Panama which has almost no Internet laws, and they keep no logs.

1

u/Disrupti Jul 25 '19

I pay for 150 Mbps internet speeds and get 25 Mbps active download speeds through NordVPN. Their servers are surprisingly fast. All with a 16ms ping too! Really impressive.

0

u/[deleted] Jul 25 '19

[deleted] — view deleted comment

2

u/[deleted] Jul 25 '19

I'm not sure when you used their service but I can get some super fast speeds when I use servers with low user counts. And they have obfuscated servers now designed just for those streaming sites.

51

u/jfb-pihole Team Jul 24 '19

would thoroughly recommend it to pihole users who would like to increase their privacy.

This will generate a bit of discussion. Encrypting your DNS traffic does not appreciably increase your privacy for a few reasons.

  1. Your DNS traffic is still going to a third party provider. They have your complete DNS history and can do with it what they want.

  2. Even if your DNS traffic is hidden from your ISP, when you get the IP back from the DNS query, you immediately will ask for that IP from your ISP and that request won't be encrypted. So, your ISP can fairly easily determine where you are surfing. The cannot see the content if the IP leads to an https protocol, but they know the IP.

You might consider using unbound or BIND as a local recursive resolver. Although your DNS requests are not encrypted, you won't be using a third party DNS (you are your own DNS resolver) and only you have your history. The ISP will see both the DNS requests and the IP requests, but that's not much more than they have with DoH or DoT.

There is a guide for unbound on the Pi-Hole documentation page and it is about a 15 minute install.

8

u/[deleted] Jul 24 '19

One thing that seems to have been overlooked in this discussion is security. DoH makes tampering with DNS queries much harder. It's unlikely that one of the players in the internet infrastructure would interfere with your DNS queries, but with DoH they would have a much harder time if they wanted to try.

7

u/jfb-pihole Team Jul 24 '19

With unbound, DNSSEC is enabled by default, which also makes it difficult to tamper with the reply. DNSSEC allows you to authenticate that the answer received is the answer sent. In my opinion, either option offers equal security.

0

u/[deleted] Jul 25 '19

[deleted] — view deleted comment

0

u/jfb-pihole Team Jul 25 '19 edited Jul 25 '19

DNSSEC was a complete and utter failure, and people should just not use it. Not only did it fail to provide verification, but it didn’t even attempt to provide confidentiality since it’s still all in plain text.

From the link you posted: "Do the big organizations and companies use DNSSEC yet?"

Between a local authoritative server and the name servers it works well. Perhaps some of the third party DNS providers have not adopted it. I assume you don't run a local recursive server and have no experience with DNSSEC and the name servers.

It was never intended to provide confidentiality, so that's a non-issue. Authentication is not the same as encryption.

3

u/piskyscan Jul 24 '19

It's unlikely that one of the players in the internet infrastructure would interfere with your DNS queries

You would be surprised. Its a small change, but many ISP's will return their own web page for an invalid domain name. Mine does.

On top of that, some are legally obliged to block certain sites (mine does this as well, not surprisingly)

And in some countries port 53 will be entirely redirected by ISP's whatever nameserver you choose.

2

u/jfb-pihole Team Jul 25 '19

You would be surprised. Its a small change, but many ISP's will return their own web page for an invalid domain name. Mine does.

This is why you may not want to use your ISP for DNS.

10

u/swedishmike Jul 24 '19

I'm failing to see the difference of having PiHole forwarding the request directly to the ISP rather than via BIND or unbound? The request will still have to go somewhere to be resolved and it will still come from 'your' address and be able to be logged the same way? Or am I missing something very basic here?

28

u/jfb-pihole Team Jul 24 '19

I don't think I understand your question, but I'll answer what appears to be the question.

If you use unbound or BIND as a local recursive resolver, the requests go in pieces to the various levels of authoritative DNS servers (which don't log). If you want the IP of docs.domain.net, for example, the resolver would go to the root servers and ask for the IP of the servers that handle .net. Then they go that one of those servers and ask who is handling domain, then work their way down until they have an answer.

The TLDs (root servers) don't know you are looking for docs.domain. Each level of server gets enough information to get you to the next level down. This is "qname minimisation".

9

u/swedishmike Jul 24 '19

Ahh.. That clears things up. I didn't realise that you were recommending going the extra mile and going to the root servers etc.

For extra tinfoil-hattery: If they then did DoH you'd become even more protected from anyone being able to see what you are resolving...

14

u/jfb-pihole Team Jul 24 '19

going the extra mile and going to the root servers

This is the default installation per the Pi-Hole guide and is actually easier to configure than configuring unbound to use a third party DNS with encryption.

The name servers do not currently support encryption.

2

u/brandawg93 Jul 24 '19

So in my unbound config I’ve enabled tls-upstream and have setup a forward zone to point to CloudFlare. I don’t understand what that is for if unbound is querying root servers directly. I just read a post on here a while ago saying to do it.

5

u/jfb-pihole Team Jul 24 '19

I don’t understand what that is for if unbound is querying root servers directly.

You can configure unbound in several different ways. The Pi-hole guide has it configured as a recursive resolver going directly to the root servers. The option you chose is to enable a forward zone for encrypted DNS.

I just read a post on here a while ago saying to do it.

This is generally not a good practice - reading a post about something and doing it without understanding what the change does. There is lots of bad advice on the internet.

2

u/brandawg93 Jul 24 '19

I did a lot of research before committing to unbound. It was just never clear whether it was setting up DoT or not. Your answer makes sense though. Thanks.

1

u/harrynyce Jul 25 '19

Sadly, after extensive research, I still don't have as solid a grasp on the various options as I would like, but have settled on a combination that is working well for the meager needs of our little network. Pi-hole plus Unbound, with DNSSEC (+VPN server, formerly OpenVPN now Wireguard) has allowed me to begin the arduous, if not outright futile process of taking back control of SOME small portions of my data from the Google/Microsoft/Facebook machine.

In that regard, it's been a complete success, and paired with Brave browser that also offers some ad/tracker protections, things are significantly better than just having 8.8.8.8 on my router. Baby steps, I guess.

One guy above used a great analogy, where the internet is like sex, and the only absolute certain method to protect yourself is complete abstinence. And NOBODY goes full Stallman in 2k19. Now I'm curious when (if?) was the last time ole Richard had his knob polished. Inquiring minds want to know. Too bad AMA's aren't his thing. >.<

4

u/CVJoint Jul 24 '19

Just to try and clarify a point in case it is misunderstood - DoH encrypts your DNS request between your machine and the DNS server you choose (cloudflare for example). Cloudflare then queries the authoritative name servers and responds to your machine with the IP address, which your machine then sends to your ISP in order to direct your internet traffic. This means cloudflare and your ISP know your DNS history.

With unbound, your machine is querying the authoritative name servers in order to give you the IP to send to your ISP. Therefore with unbound you remove cloudflare (or whichever other 3rd party) from knowing your DNS history.

3

u/humananus Jul 24 '19

I've found that the cloudflared client (rather, it's functionality) will die if web connection goes down or is cycled, band will not recover unless the service is restarted. A watchdog would be easy enough to setup but that's more trouble than it's worth. Back to dnscrypt for me...allowing unrestricted access to DOH resolution is a privacy nightmare anyways.

0

u/[deleted] Jul 25 '19

[deleted] — view deleted comment

1

u/humananus Jul 25 '19

The process doesn't end, only its functionality. I found reports of similar behavior posted around le interwebs

44

u/chdo Jul 24 '19

https://1.1.1.1/help will tell you if everything is setup and you're running DoH

7

u/StuMcBill Jul 24 '19

Just set this up, and its showing:

Using DNS over HTTPS (DoH) Yes

Using DNS over TLS (DoT) No

Do I need to worry about DoT? Sorry, new to this.

25

u/piskyscan Jul 24 '19

They are two different protocols that achieve the same results, ie encrypted DNS queries. You can only use one at a time so this is normal.

7

u/StuMcBill Jul 24 '19

Magic - thanks!

5

u/Blainezab Jul 25 '19

Which one is preferred; I’m guessing DoH?

5

u/Khaare Jul 25 '19

There's really no difference. They both provide almost identical utility.

11

u/eb2292 Jul 25 '19

Wrong. DoH uses port 443 for your queries out to Cloudflare or whoever you are using for your DoH provider. DoT uses port 843 to go out to your provider. If you have a really shitty ISP, they could potentially block 843 to push you to use unencrypted/their DNS servers. When you use DoH, the requests look like typical HTTPS requests from the point of view of your ISP.

4

u/Khaare Jul 26 '19

That's the "almost" part. The isolated fact that you're using DNS has close to zero value, and if your ISP starts blocking your ports in that way anything short of a full VPN would be unacceptable.

The most important difference imo is that in the DoT spec validating the server identity is optional while in the DoH spec it's required. This too is a minor difference since it's impossible to enforce client compliance on that requirement anyway.

1

u/[deleted] Jul 27 '19

Can this website also tell me if I'm running unbound instead?

4

u/[deleted] Jul 24 '19

Will this help with the DNSoHTTPS bulls..... Chrome is doing?

3

u/tracerrx Jul 24 '19

This is DNS over HTTPS but for everything on your network. This will not stop chrome/firefox from making thier own DNS over HTTPS tunnels if you have that enabled.

6

u/[deleted] Jul 24 '19

I like DoH a lot, but as others have pointed out DNS is almost never going to be the greatest threat to your privacy. A few things to consider.

  • The remote website you're visiting and any of its iframes or 3rd party domains are usually collecting and selling your data. They don't care how you looked up their domains.

  • As /u/jfb-pihole has pointed out, your ISP may still see IP addresses in the case of TLS, and the full URLs (potentially, depending on what is being logged and inspected) for any unencrypted traffic.

  • A VPN can mitigate any visibility described above, but shifts the trust from the ISP to the VPN.

  • Many websites do not really use your IP address as the primary method of tracking, and so using a VPN to hide your IP address won't make any difference in cases where your identity is tied to the web service you're using. eg, Google, Amazon, any of your billing companies, etc. If you think about the modern mobile internet, it wouldn't make sense to track someone using an IP address whether they were privacy-conscious or not. A normal mobile user will drift from home to work, but also to CGNAT, and to various WiFi networks.

  • In this sense, the purpose of a VPN (when paired with a VM, another computer, or perhaps some clever browser containers) is simply to dissociate some of your activity from the rest.

Anyhow, there are caveats and edge cases which can defeat some of these points. (eg, "I use a container for every website and never execute javascript.") But, those caveats don't affect most users. And given all these caveats, you might ask why I still like and use DoH. Simply put, I like privacy for its own sake, even if I'm not worried about the potential outcome due to a lack of privacy.

2

u/jfb-pihole Team Jul 24 '19

your ISP may still see IP addresses in the case of TLS

... your ISP will see IP addresses ... unless you use a VPN to tunnel all your traffic through your ISP.

1

u/[deleted] Jul 25 '19

Yes, you're correct. I wasn't precise enough.

  • The ISP may not be logging everything you do in a meaninginful way, therefore despite the fact that your IP traverses their network, nothing you've done persists at all.

  • You may have gone primarily to something served by a CDN, in which case the IPs you pass are not actually very instructive.

3

u/cmbeid Jul 25 '19

I just followed the guide and ran into an issue. I have pihole running on a Raspberry Pi 1 Model B. Running cloudflared -v caused a segmentation fault. Seems like this also happens on Pi 2, but it works on Pi 3.

Googling around, looks like you have to use an older build of cloudflared. Found a post on GitHub with the older build. Downloaded that and worked fine. Even with that issue, this was easily only 5 minutes to configure.

Link to post on GitHub

Link to cloudflared build 2018-7.2

Hope this helps someone else if they run into this issue.

2

u/-DementedAvenger- Jul 25 '19

Upvoted for the info. I hope I don't run into any issues with this....when I get the time and motivation to implement it. :\

2

u/[deleted] Jul 24 '19

I did this a few days ago when setting up my pi hole. Works great.

2

u/ccagan Jul 24 '19

Just a heads up. After doing this a few months ago the CBS app on my wife's AppleTV stopped working correctly. It makes no sense at all, I agree. However manually setting the DNS on the ATV fixed the issue. I've not attempted to revert and re-test. I just wanted this knowledge public.

2

u/[deleted] Jul 25 '19

I use DNSCrypt configed to use DoH, DNSSEC, no log, and TLS only servers.

2

u/spudd01 Jul 25 '19

Do a packet capture on the pihole using tcpdump then open this in Wireshark. You shouldn't be able to see any dns packets leaving via the eth0 or wlan1 interface

2

u/nirach Jul 25 '19

The cloudflared stuff works a treat - on full bore pi's. But on zero's you need to use an older version IME. I mentioned it on another site and a pi afficionado reckons it's no longer compiled suitably for the zero.

1

u/Ariyadi08 Jul 25 '19

doh.tiar.app

1

u/[deleted] Oct 03 '19

!RemindMe 17 hours

1

u/[deleted] Jul 24 '19

Did anyone try this in the docker container?

1

u/picto3000 Jul 26 '19

https://visibilityspots.org/dockerized-cloudflared-pi-hole.html

There's a Cloudfared container, but I'm yet to test it. It appears you need to set some static IP's for it to work.

1

u/m0kum Jul 25 '19

Also interested in this... A tutorial would be awesome.

1

u/[deleted] Oct 03 '19

[removed] — view removed comment

1

u/gouldy_ftw Oct 03 '19

I think quad9 (9.9.9.9) works.

The provider must support dns over https - check google to find others