16
21.1 Legacy Series / Re: DNS doesn't work for quite a while (or at all) after rebooting
« on: June 13, 2021, 03:21:59 pm »
Manually saving in 'System: Settings: General' will force whatever DNS configuration you have to re-initialize, so it sounds like DNS isn't being correctly configured and initialized properly at boot. To try and narrow down what's happening, perhaps you could try the following with Unbound.
Then reboot the system, immediately start a shell session and check for the following
Is unbound running?
If it's not running, check to see if the generated config file exists and contains something meaningful. It should look something like the following
If it is running, will it respond to queries?
If it will respond to queries locally, the issue will likely be with firewall rules.
- Configure 'Services: Unbound DNS: General'. Defaults should be fine, but the most important options are likely
- Enable: checked
- Network Interfaces: All
- Outgoing Network Interfaces: All
- Configure the system to use Unbound in 'System: Settings: General'
- DNS servers: blank
- Allow DNS server list to be overridden by DHCP/PPP on WAN: unchecked
- Do not use the local DNS service as a nameserver for this system: unchecked
Then reboot the system, immediately start a shell session and check for the following
Is unbound running?
Code: [Select]
root@OPNsense:~ # ps auxwww | grep unbound
unbound 78629 0.0 1.2 99436 49424 - Is Mon20 0:17.84 /usr/local/sbin/unbound -c /var/unbound/unbound.conf
root 60108 0.0 0.1 1060900 3196 3 R+ 21:08 0:00.00 grep unboundIf it's not running, check to see if the generated config file exists and contains something meaningful. It should look something like the following
Code: [Select]
root@OPNsense:~ # head -n 20 /var/unbound/unbound.conf
##########################
# Unbound Configuration
##########################
##
# Server configuration
##
server:
chroot: /var/unbound
username: unbound
directory: /var/unbound
pidfile: /var/run/unbound.pid
root-hints: /var/unbound/root.hints
use-syslog: yes
port: 53
[...]
If it is running, will it respond to queries?
Code: [Select]
root@OPNsense:~ # drill @127.0.0.1 google.com
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 46171
;; flags: qr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; google.com. IN A
;; ANSWER SECTION:
google.com. 300 IN A 172.217.17.110
;; AUTHORITY SECTION:
;; ADDITIONAL SECTION:
;; Query time: 1294 msec
;; SERVER: 127.0.0.1
;; WHEN: Sun Jun 13 21:09:59 2021
;; MSG SIZE rcvd: 44
If it will respond to queries locally, the issue will likely be with firewall rules.

