Solved: Network trouble (DNS, resolv.conf) and HASSIO

Hi again

Last year I posted about my network issues with hassio. Last time I gave up and went back to hassbian. But now I thought about giving it another try but still no luck. There is some strange things going on.

The problem is that I can not do a dns lookup inside the homeassistant container. I will give some information about my setup.

router:

IP: 192.168.1.1
DNS 1: 	 192.168.1.1 
DNS 2: 	 193.213.112.4
DNS 3: 	 130.67.15.198

My Rasperrypi:

    docker0   Link encap:Ethernet  HWaddr 02:42:3B:61:F8:40
              inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
              inet6 addr: fe80::42:3bff:fe61:f840/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:29798 errors:0 dropped:0 overruns:0 frame:0
              TX packets:39712 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:2301363 (2.1 MiB)  TX bytes:4903801 (4.6 MiB)

    eth0      Link encap:Ethernet  HWaddr B8:27:EB:E8:6F:0F
              inet addr:192.168.1.119  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fd65:3d40:e0ec:0:dfbf:5d39:a909:91d2/64 Scope:Global
              inet6 addr: 2001:4664:cec4:0:ce5c:6c71:56e0:3887/64 Scope:Global
              inet6 addr: fe80::4464:c0b0:b552:af3c/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:308262 errors:0 dropped:0 overruns:0 frame:0
              TX packets:272300 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:57003133 (54.3 MiB)  TX bytes:47343266 (45.1 MiB)

    hassio    Link encap:Ethernet  HWaddr 02:42:A5:54:66:68
              inet addr:172.30.32.1  Bcast:0.0.0.0  Mask:255.255.254.0
              inet6 addr: fe80::42:a5ff:fe54:6668/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:31817 errors:0 dropped:0 overruns:0 frame:0
              TX packets:69969 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:3648262 (3.4 MiB)  TX bytes:13028722 (12.4 MiB)

    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:29193 errors:0 dropped:0 overruns:0 frame:0
              TX packets:29193 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1
              RX bytes:2565981 (2.4 MiB)  TX bytes:2565981 (2.4 MiB)

    veth18a481c Link encap:Ethernet  HWaddr CA:06:19:8C:8E:CB
              inet6 addr: fe80::c806:19ff:fe8c:8ecb/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:26868 errors:0 dropped:0 overruns:0 frame:0
              TX packets:63922 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:8580670 (8.1 MiB)  TX bytes:12306235 (11.7 MiB)

    veth33dfe13 Link encap:Ethernet  HWaddr 82:47:E9:48:AC:ED
              inet6 addr: fe80::8047:e9ff:fe48:aced/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:23699 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:0 (0.0 B)  TX bytes:2474132 (2.3 MiB)

    veth6cc0a81 Link encap:Ethernet  HWaddr DA:10:A6:9E:62:B1
              inet6 addr: fe80::d810:a6ff:fe9e:62b1/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:9099 errors:0 dropped:0 overruns:0 frame:0
              TX packets:34043 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:1838548 (1.7 MiB)  TX bytes:3624442 (3.4 MiB)

    veth7e59c44 Link encap:Ethernet  HWaddr 72:59:6C:DC:D2:EC
              inet6 addr: fe80::7059:6cff:fedc:d2ec/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:21974 errors:0 dropped:0 overruns:0 frame:0
              TX packets:45380 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:1535205 (1.4 MiB)  TX bytes:9889662 (9.4 MiB)

    veth8e0d26b Link encap:Ethernet  HWaddr 66:B5:2F:D2:D5:50
              inet6 addr: fe80::64b5:2fff:fed2:d550/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:29798 errors:0 dropped:0 overruns:0 frame:0
              TX packets:39729 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:2718535 (2.5 MiB)  TX bytes:4906551 (4.6 MiB)

    wlan0     Link encap:Ethernet  HWaddr 0A:80:7B:A1:6D:E3
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:35906 errors:0 dropped:35906 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:16054798 (15.3 MiB)  TX bytes:0 (0.0 B)

Everything works from here (I can ping and so on):

root@hassio:~# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.1
nameserver 193.213.112.4
nameserver 130.67.15.198
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 8.8.8.8
nameserver 2001:4600:4:1fff::53
nameserver 2001:4600:4:fff::53

When I enter a container things doesn’t work.

root@hassio:~# docker container exec -ti homeassistant /bin/bash
bash-4.4# cat /etc/resolv.conf
nameserver 172.30.32.2
options ndots:0

When I’m on the page I get no information from YR, but things that uses IP works. Another thing is that I’m able to install hassio addon’s and so on without any problems.

So my question is. How can I get nameserver 8.8.8.8 into the homeassistant container?

Case closed… The problem was that I had 192.168.1.1 as the first dns server on my router…

I was going to ask why you had that!

The truth is that I don’t remember why I did that… Maybe for lookup of local names. It has been like that for several years… No trouble before hassio…