However, I don’t know how to ssh into the OH container to run nslookup there and compare the results or do some other investigation from within the container.
You can’t ssh into the OH pod but you can use kubectl, first you need to find the pod id for OH:
pi@k3s-master-1:~ $ kubectl get pods
NAME READY STATUS RESTARTS AGE
influxdb-7989845b67-5fqh7 0/1 Unknown 0 75d
grafana-b84d897fb-mj5fc 1/1 Running 2 105d
nfs-client-provisioner-openhab-production-5cc5d6c7d4-dqs65 1/1 Running 7 54d
nfs-client-provisioner-58987d578-m9zvm 1/1 Running 4 54d
nfs-client-provisioner-dump1090-647fcc45db-ln6t5 1/1 Running 3 50d
openhab-79f845bc8c-npkdh 1/1 Running 0 2d2h
busybox 1/1 Running 1873 78d
Lets connect to pod openhab-79f845bc8c-npkdh using kubectl:
pi@k3s-master-1:~ $ kubectl exec -it openhab-79f845bc8c-npkdh /bin/bash
root@openhab-79f845bc8c-npkdh:/openhab# ls
addons conf dist lib LICENSE.TXT runtime start_debug.sh start.sh userdata
However the OH container used does not include nslookup nor ping commands, but you can use arping to check if DNS points to correct IP.
NOTE: arping will not be able to actually ping external IPs:
root@openhab-79f845bc8c-npkdh:/openhab# arping -c 1 dl.bintray.com
arping: lookup dev: No matching interface found using getifaddrs().
arping: Unable to automatically find interface to use. Is it on the local LAN?
arping: Use -i to manually specify interface. Guessing interface eth0.
ARPING 3.124.133.231
Timeout
--- 3.124.133.231 statistics ---
1 packets transmitted, 0 packets received, 100% unanswered (0 extra)
root@openhab-79f845bc8c-npkdh:/openhab# arping -c 1 dl.bintray.com
arping: lookup dev: No matching interface found using getifaddrs().
arping: Unable to automatically find interface to use. Is it on the local LAN?
arping: Use -i to manually specify interface. Guessing interface eth0.
ARPING 52.29.129.139
Timeout
--- 52.29.129.139 statistics ---
1 packets transmitted, 0 packets received, 100% unanswered (0 extra)
root@openhab-79f845bc8c-npkdh:/openhab# arping -c 1 dl.bintray.com
arping: lookup dev: No matching interface found using getifaddrs().
arping: Unable to automatically find interface to use. Is it on the local LAN?
arping: Use -i to manually specify interface. Guessing interface eth0.
ARPING 52.29.129.139
Timeout
--- 52.29.129.139 statistics ---
1 packets transmitted, 0 packets received, 100% unanswered (0 extra)
Doing an nslookup from my local MAC gives the same IPs:
$ nslookup dl.bintray.com
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: dl.bintray.com
Address: 3.124.133.231
Name: dl.bintray.com
Address: 52.29.129.139
I had some problems with kube-proxy and IP tables that required a w.o. to get networking to work, don’t know if that could be connected.
The IP adress that you got dl.bintray.com/149.172.19.157
is:
$ nslookup 149.172.19.157
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
157.19.172.149.in-addr.arpa name = HSI-KBW-149-172-19-157.hsi13.kabel-badenwuerttemberg.de.
Is that maybe an IP address belonging to your ISP?
What I suggest you do is to install a pod based on a container that has all the network commands to be able to debug your network, e.g. busybox. Then you can issue a command on the busybox pod via kubectl exec -it
:
pi@k3s-master-1:~ $ kubectl exec -it busybox nslookup www.dn.se
Server: 192.168.1.1
Address 1: 192.168.1.1 router.asus.com
Name: www.dn.se
Address 1: 95.101.172.101 a95-101-172-101.deploy.static.akamaitechnologies.com
pi@k3s-master-1:~ $ kubectl exec -it busybox ping www.dn.se
PING www.dn.se (95.101.172.101): 56 data bytes
64 bytes from 95.101.172.101: seq=0 ttl=58 time=2.964 ms
64 bytes from 95.101.172.101: seq=1 ttl=58 time=6.728 ms
64 bytes from 95.101.172.101: seq=2 ttl=58 time=2.438 ms
^C
--- www.dn.se ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 2.438/4.043/6.728 ms
BR,
/Janne