SelfSD Posted March 18, 2023 Share Posted March 18, 2023 Hey guys! So my second Unraid server that runs Pihole has a dead motherboard and I figured it's time to set up a backup Pihole instead of using a public DNS service as backup. However at the moment my second DNS server is 1.1.1.1 and Unraid won't use it at all even when the primary DNS server is down. Server was rebooted not too long ago as I thought that would fix it but no luck. Is this a bug in Unraid or do I have to configure something more than just have 2 DNS servers specified? unraid-diagnostics-20230318-2257.zip Quote Link to comment
Squid Posted March 18, 2023 Share Posted March 18, 2023 You don't have any DNS servers set up in the config # Generated settings: IFNAME[0]="br0" BRNAME[0]="br0" BRSTP[0]="no" BRFD[0]="0" DESCRIPTION[0]="10G" BRNICS[0]="eth0" PROTOCOL[0]="ipv4" USE_DHCP[0]="yes" DHCP_KEEPRESOLV="no" USE_DHCP6[0]="yes" DHCP6_KEEPRESOLV="no" SYSNICS="1" Quote Link to comment
SelfSD Posted March 18, 2023 Author Share Posted March 18, 2023 It's all through DHCP. Quote Link to comment
Squid Posted March 18, 2023 Share Posted March 18, 2023 Then the problem is with your router / other system / piHole. Your system isn't going to use anything other than the gateway for its DNS Server Quote Link to comment
SelfSD Posted March 18, 2023 Author Share Posted March 18, 2023 Like I wrote in the initial post, my Pihole is down and all my other devices are currently using 1.1.1.1 without issues. Only my Unraid is not using the secondary DNS server for some reason. Virtual machines are using DNS 2 and docker containers are still running fine so I assume they are also doing so. It's just the host struggling. ☹️ Quote Link to comment
ljm42 Posted March 19, 2023 Share Posted March 19, 2023 Looks like in Linux, the name servers are queried in order: https://linux.die.net/man/5/resolv.conf ...If there are multiple servers, the resolver library queries them in the order listed.... I'd adjust your DHCP server so that it doesn't hand out the failing DNS server. 1 Quote Link to comment
SelfSD Posted March 19, 2023 Author Share Posted March 19, 2023 After I used nano to see if the /etc/resolv.conf file had any config in it, saving out of habit without modifying anything and closing it, my server does now reach out to the secondary DNS server. Although each request takes about 5 seconds as I'm guessing it's trying to use the primary each time and timing out it works for now. The server log added this so maybe it just needed a refresher: Mar 19 13:10:51 UnRaid dnsmasq[19036]: reading /etc/resolv.conf Mar 19 13:10:51 UnRaid dnsmasq[19036]: using nameserver 192.168.0.22#53 Mar 19 13:10:51 UnRaid dnsmasq[19036]: using nameserver 192.168.0.23#53 Quote Link to comment
SelfSD Posted March 19, 2023 Author Share Posted March 19, 2023 Another update. I unplugged and reconnected my server to see if it would update the DNS servers with my backup Pihole. Curiously enough, it only added the first DNS server to resolv.conf and not both even though .22 and .23 are both in the GUI as IPv4 DNS servers. resolv.conf is as follows: # Generated by dhcpcd from br0.dhcp domain KTS20 nameserver 192.168.0.22 It lost the second DNS server At least now I know how to manually add the second DNS server, so thank you @ljm42 for the link! The log says the following: Mar 19 13:32:07 UnRaid kernel: mlx4_en: eth0: Link Down Mar 19 13:32:07 UnRaid kernel: br0: port 1(eth0) entered disabled state Mar 19 13:32:27 UnRaid avahi-dnsconfd[18816]: DNS Server 192.168.0.22 removed (interface: 7.IPv4) Mar 19 13:32:27 UnRaid dnsmasq[19036]: no servers found in /etc/resolv.conf, will retry Mar 19 13:32:27 UnRaid dnsmasq[19036]: reading /etc/resolv.conf Mar 19 13:32:27 UnRaid dnsmasq[19036]: using nameserver 192.168.0.22#53 Mar 19 13:32:43 UnRaid kernel: mlx4_en: eth0: Link Up Mar 19 13:32:43 UnRaid kernel: br0: port 1(eth0) entered blocking state Mar 19 13:32:43 UnRaid kernel: br0: port 1(eth0) entered forwarding state Mar 19 13:34:16 UnRaid avahi-dnsconfd[18816]: New DNS Server 192.168.0.22 (interface: 7.IPv4) Mar 19 13:34:16 UnRaid dnsmasq[19036]: no servers found in /etc/resolv.conf, will retry Mar 19 13:34:16 UnRaid dnsmasq[19036]: reading /etc/resolv.conf Mar 19 13:34:16 UnRaid dnsmasq[19036]: using nameserver 192.168.0.22#53 Quote Link to comment
ljm42 Posted March 19, 2023 Share Posted March 19, 2023 Your screenshot shows that "IPV4 DNS Server assignment" is set to automatic. I would disable that and just set the specific DNS server you want. Or do it at the DHCP level and set it to just the working DHCP server for your whole network. Quote Link to comment
SelfSD Posted March 20, 2023 Author Share Posted March 20, 2023 I ended up changing the IP address of the backup Pihole to the primary for now until I get my second server up and running. Still odd that Unraid doesn't apply both DNS servers to the configuration file from DHCP. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.