Skip to content

Commit b8b3792

Browse files
committed
FreeBSD update for version 14.0 and later
1 parent 2810673 commit b8b3792

File tree

2 files changed

+21
-36
lines changed

2 files changed

+21
-36
lines changed

docs/assets/conf/freebsd/unbound.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ server:
44
username: unbound
55
directory: /var/unbound
66
chroot: /var/unbound
7-
pidfile: /var/run/local_unbound.pid
87
#auto-trust-anchor-file: /var/unbound/root.key
9-
tls-cert-bundle: /etc/ssl/cert.pem
8+
pidfile: /var/run/local_unbound.pid
9+
tls-cert-bundle: /usr/local/share/certs/ca-root-nss.crt
1010

1111
include: /var/unbound/forward.conf
1212
include: /var/unbound/lan-zones.conf

docs/en/Setup_Guides/Linux_and_BSD/FreeBSD_(Encrypted).md

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This article describes how to configure and use FreeBSD's pre-installed "local_unbound" service in order to send encrypted DNS via DNS over TLS to Quad9.
44

5-
This was tested using FreeBSD 13.1, but should work with 12.X as well.
5+
This was tested using FreeBSD 14.3 and may not work with prior branches (13.x, etc).
66

77
!!! warning "Firefox, VPNs"
88
* **Firefox** is set to use Cloudflare DNS by default in some regions. If you're using Firefox, check that [this is disabled](https://support.mozilla.org/en-US/kb/dns-over-https#w_configure-doh-protection-settings).
@@ -11,23 +11,29 @@ This was tested using FreeBSD 13.1, but should work with 12.X as well.
1111
!!! warning
1212
FreeBSD, by default, installs a local instance of Unbound DNS. This is meant to act as a local, caching DNS forwarder for the local machine only, and is not intended to act as a DNS forwarder for other network devices. If you want to run Unbound DNS on FreeBSD for the purposes of running a caching DNS forwarder that will be used by multiple devices on the network, FreeBSD recommends installing the dns/unbound package instead. These instructions are only valid for the "local_unbound" service.
1313

14-
## Instructions
14+
## Prerequisites
1515

16-
You will need the sudo command to run the commands below. Alternatively, you can simply use the su command to become the root user and execute these commands directly as the root user, in which case, you'll need to remove "sudo" from all the commands below.
16+
For simplicity, these instructions require that you are logged in as, or `su`d to the **root** user.
1717

1818
* Install the dig command so you can test DNS resolution is working as expected:
1919

2020
```
2121
pkg install bind-tools
2222
```
2323

24+
* Install the standard root/CA store so Unbound can perform TLS validation of the Quad9 certificate.
25+
26+
```
27+
pkg install ca_root_nss
28+
```
29+
2430
* Verify local_unbound is Enabled
2531

2632
```
27-
sudo grep unbound /etc/rc.conf
33+
grep unbound /etc/rc.conf
2834
```
2935

30-
If the following output is produced, local_unbound is already enabled, and you can skip to the next section:
36+
If the following output is produced, local_unbound is already enabled, and you can skip to the **Instructions** section:
3137

3238
```
3339
local_unbound_enable="YES"
@@ -48,7 +54,7 @@ reboot
4854
* Enable local_unbound:
4955

5056
```
51-
sudo local-unbound-setup
57+
local-unbound-setup
5258
```
5359

5460
The output should similar to this, but may differ slightly:
@@ -65,53 +71,32 @@ Starting local_unbound.
6571
/etc/resolvconf.conf created
6672
Original /etc/resolv.conf saved as /var/backups/resolv.conf.20220625.200835
6773
```
74+
## Instructions
6875

69-
Configuring local_unbound for DNS over TLS to Quad9
76+
* Configuring local_unbound for DNS over TLS to Quad9
7077

7178
This command will back up the default configuration files, download the modified config files from the attachment of this article, and restart the local_unbound service.
7279

7380
```
74-
sudo mv /var/unbound/forward.conf /var/unbound/forward-ORIG.conf && sudo mv /var/unbound/unbound.conf /var/unbound/unbound-ORIG.conf && sudo fetch -o /var/unbound/unbound.conf https://docs.quad9.net/assets/conf/freebsd/unbound.conf && sudo fetch -o /var/unbound/forward.conf https://docs.quad9.net/assets/conf/freebsd/forward.conf && sudo service local_unbound restart
81+
mv /var/unbound/forward.conf /var/unbound/forward-ORIG.conf && mv /var/unbound/unbound.conf /var/unbound/unbound-ORIG.conf && fetch -o /var/unbound/unbound.conf https://docs.quad9.net/assets/conf/freebsd/unbound.conf && fetch -o /var/unbound/forward.conf https://docs.quad9.net/assets/conf/freebsd/forward.conf && service local_unbound restart
7582
```
7683

77-
These files are configured for our 9.9.9.9 service by default, without IPv6. If you'd like to use the .10 or .11 service instead, and/or enable IPv6, open the `/var/unbound/forward.conf` file and un-comment/comment out the appropriate lines.
84+
These files are configured for the 9.9.9.9 service by default, without IPv6. If you'd like to use the .10 or .11 service instead, and/or enable IPv6, open the `/var/unbound/forward.conf` file and un-comment/comment out the appropriate lines.
7885

7986
## Verify Configuration
8087

81-
You'll need two Terminal sessions/windows
82-
83-
In the first session, start a packet capture to filter for DNS over TLS traffic:
84-
85-
```
86-
sudo tcpdump -n 'port 853'
87-
```
88-
89-
In the second session, generate some DNS lookups:
90-
91-
```
92-
dig +short quad9.net && dig +short www.quad9.net && dig +short zombo.com
93-
```
94-
95-
Refer back to the first session. If you see any output, your system is now using DNS over TLS to send encrypted DNS to Quad9:
88+
Using the [Quad9 Protocol test](https://docs.quad9.net/FAQs/#protocol-test-confirm-on-which-protocol-quad9-received-your-query), the result should be `dot.`, which indicates your queries are being sent to Quad9 and are encrypted with DNS over TLS:
9689

9790
```
98-
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
99-
listening on em0, link-type EN10MB (Ethernet), capture size 262144 bytes
100-
20:30:21.004625 IP 192.168.1.118.29017 > 149.112.112.112.853: Flags [S], seq 255439876, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS val 2441683586 ecr 0], length 0
101-
20:30:21.011088 IP 149.112.112.112.853 > 192.168.1.118.29017: Flags [S.], seq 838572319, ack 255439877, win 28960, options [mss 1460,nop,nop,TS val 3171725219 ecr 2441683586,nop,wscale 8], length 0
102-
20:30:21.011140 IP 192.168.1.118.29017 > 149.112.112.112.853: Flags [.], ack 1, win 1027, options [nop,nop,TS val 2441683592 ecr 3171725219], length 0
103-
20:30:21.011628 IP 192.168.1.118.29017 > 149.112.112.112.853: Flags [P.], seq 1:294, ack 1, win 1027, options [nop,nop,TS val 2441683592 ecr 3171725219], length 293
104-
20:30:21.017885 IP 149.112.112.112.853 > 192.168.1.118.29017: Flags [.], ack 294, win 118, options [nop,nop,TS val 3171725226 ecr 2441683592], length 0
105-
20:30:21.018447 IP 149.112.112.112.853 > 192.168.1.118.29017: Flags [.], seq 1:1449, ack 294, win 118, options [nop,nop,TS val 3171725227 ecr 2441683592], length 1448
106-
20:30:21.018453 IP 149.112.112.112.853 > 192.168.1.118.29017: Flags [.], seq 1449:2897, ack 294, win 118, options [nop,nop,TS val 3171725227 ecr 2441683592], length 1448
91+
dig +short txt proto.on.quad9.net.
10792
```
10893

10994
## Undo
11095

11196
To undo the configuration changes to local_unbound, simply run this command to restore the original files and restart local_unbound:
11297

11398
```
114-
sudo mv /var/unbound/forward-ORIG.conf /var/unbound/forward.conf && sudo mv /var/unbound/unbound-ORIG.conf /var/unbound/unbound.conf && sudo service local_unbound restart
99+
mv /var/unbound/forward-ORIG.conf /var/unbound/forward.conf && mv /var/unbound/unbound-ORIG.conf /var/unbound/unbound.conf && service local_unbound restart
115100
```
116101

117102
Questions? Issues? Didn't work? Contact us!

0 commit comments

Comments
 (0)