Local DNS server + DynDNS
by pompopom from LinuxQuestions.org on (#555ZX)
Hi everyone,
Having a hard time, getting this to work properly
GOAL: I have several hosts (physical) and virtual hosts (web) registered at Dyn.com. The machines are reachable from the outside AND the local LAN (both with the public IP).
In order to limit bandwith usage however my idea was to have an Local PC be able to resolve the internal IP of the host.
So I set up a DNS server. The idea is that this server only resolves hosts which reside on local network. Other requests should be forwarded to Google's or my ISP's DNS.
I now receive a local IP from DNS when connected to LAN and a public IP abroad without having to change config in some applications (as Nextcloud just to mention one)
However when trying to resolve other domains it doesn't behave as it should. The DNS server doesn't forward requests and the DNS times-out. The reason I'm able to browse the web and post this thread is the secondary DNS entry. If I remove this from the dhcp config and provide only my local DNS to dhcp clients, nothing works.
So I started to dive deeper in what was going on. And then it quickly escalated in unbelieve... From the DNS server I can 't ping 8.8.8.8, let alone google.be. From another machine on the LAN I can ping 8.8.8.8 and do nslookups IF I remove my DNS from the config
apt-get update and even an upgrade do work on the DNS server. So network connectivity is alive.
"route" outputs the same beside Iface name
/etc/resolv.conf = same (it wasn't originally, but I copied from the working machine to the DNS)
/etc/nsswitch.conf = same
/etc/hosts = same (besides the actual hostname off course)
Both have ufw running, but when I disable, nothing changes
Traceroute 8.8.8.8 on the DNS server just continues for 30 "hops" and stops
On the working machine output as expected.
I even changed the Iface name to eth0 on the DNS server, as it was the only thing that was different.
Currently bind9 is not even running, but to no avail...
Both machines are physically at the same place, connected to the same switch which is in turn behind a Unifi USG
Code:root@menelaos:~# uname -a
Linux menelaos 4.19.0-9-686-pae #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) i686 GNU/Linux
root@menelaos:~# cat /etc/debian_version
10.4
root@menelaos:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
root@menelaos:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=17.3 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.261 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=4.14 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.261 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 8ms
rtt min/avg/max/mdev = 0.261/5.502/17.346/7.019 ms
root@menelaos:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
11 packets transmitted, 0 received, 100% packet loss, time 228ms
root@menelaos:~# traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 192.168.1.1 (192.168.1.1) 17.545 ms 35.266 ms 64.586 ms
2 192.168.0.1 (192.168.0.1) 93.811 ms 113.231 ms 131.678 ms
3 * * *
4 * * *
5 * * *
6 * * *
*SNIP* (it's just always the same line)
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *
root@menelaos:~# apt-get update
Hit:1 http://ftp.be.debian.org/debian buster InRelease
Hit:2 http://ftp.be.debian.org/debian-security buster/updates InRelease
Hit:3 http://ftp.be.debian.org/debian buster-updates InRelease
Reading package lists... Done
root@menelaos:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@menelaos:~#I'm out of ideas at the moment...
btw: yes I did try to turn it off and on again...


Having a hard time, getting this to work properly
GOAL: I have several hosts (physical) and virtual hosts (web) registered at Dyn.com. The machines are reachable from the outside AND the local LAN (both with the public IP).
In order to limit bandwith usage however my idea was to have an Local PC be able to resolve the internal IP of the host.
So I set up a DNS server. The idea is that this server only resolves hosts which reside on local network. Other requests should be forwarded to Google's or my ISP's DNS.
I now receive a local IP from DNS when connected to LAN and a public IP abroad without having to change config in some applications (as Nextcloud just to mention one)
However when trying to resolve other domains it doesn't behave as it should. The DNS server doesn't forward requests and the DNS times-out. The reason I'm able to browse the web and post this thread is the secondary DNS entry. If I remove this from the dhcp config and provide only my local DNS to dhcp clients, nothing works.
So I started to dive deeper in what was going on. And then it quickly escalated in unbelieve... From the DNS server I can 't ping 8.8.8.8, let alone google.be. From another machine on the LAN I can ping 8.8.8.8 and do nslookups IF I remove my DNS from the config
apt-get update and even an upgrade do work on the DNS server. So network connectivity is alive.
"route" outputs the same beside Iface name
/etc/resolv.conf = same (it wasn't originally, but I copied from the working machine to the DNS)
/etc/nsswitch.conf = same
/etc/hosts = same (besides the actual hostname off course)
Both have ufw running, but when I disable, nothing changes
Traceroute 8.8.8.8 on the DNS server just continues for 30 "hops" and stops
On the working machine output as expected.
I even changed the Iface name to eth0 on the DNS server, as it was the only thing that was different.
Currently bind9 is not even running, but to no avail...
Both machines are physically at the same place, connected to the same switch which is in turn behind a Unifi USG
Code:root@menelaos:~# uname -a
Linux menelaos 4.19.0-9-686-pae #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) i686 GNU/Linux
root@menelaos:~# cat /etc/debian_version
10.4
root@menelaos:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
root@menelaos:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=17.3 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.261 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=4.14 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.261 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 8ms
rtt min/avg/max/mdev = 0.261/5.502/17.346/7.019 ms
root@menelaos:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
11 packets transmitted, 0 received, 100% packet loss, time 228ms
root@menelaos:~# traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 192.168.1.1 (192.168.1.1) 17.545 ms 35.266 ms 64.586 ms
2 192.168.0.1 (192.168.0.1) 93.811 ms 113.231 ms 131.678 ms
3 * * *
4 * * *
5 * * *
6 * * *
*SNIP* (it's just always the same line)
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *
root@menelaos:~# apt-get update
Hit:1 http://ftp.be.debian.org/debian buster InRelease
Hit:2 http://ftp.be.debian.org/debian-security buster/updates InRelease
Hit:3 http://ftp.be.debian.org/debian buster-updates InRelease
Reading package lists... Done
root@menelaos:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@menelaos:~#I'm out of ideas at the moment...
btw: yes I did try to turn it off and on again...