Server hostname resolves to loopback instead of LAN address --> Hostname cannot be used from inside docker containers

  • My OMV instance is connected to my LAN network with IP 192.168.1.4 (DHCP, with IP reservation on opnsense router), with hostname myserver.


    I noticed that running nslookup myserver returns 127.0.1.1. As a consequence, when trying to connect between docker containers does not work using http://myserver:port but http://192.168.1.4:port works fine.


    Looking at the content of /etc/host, the hostname myserver is indeed associated with 127.0.1.1.


    Is this normal ? Is there a way to use my server hostname from inside the containers without passing the hostname mapping manually ?


    Thanks

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!