Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

No address associated with hostname; "/etc/hosts" have no entry for self #3952

Open
onlyjob opened this issue Aug 11, 2018 · 0 comments
Open

Comments

@onlyjob
Copy link

onlyjob commented Aug 11, 2018

Environment

appc Version: 0.8.11
Go Version: go1.10.3
Go OS/Arch: linux/amd64
Features: -TPM +SDJOURNAL
--
Linux 4.9.0-7-amd64 x86_64
--
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
--
systemd 239
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid

What did you do?

rkt run --net=default --hostname blah

then inside container

# ping blah
ping: zm: No address associated with hostname

# hostname
blah

# cat /etc/hosts
127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
3: eth0@if199: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 5e:e0:ae:fa:53:a4 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 172.16.28.12/24 brd 172.16.28.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5ce0:aeff:fefa:53a4/64 scope link
       valid_lft forever preferred_lft forever

/etc/hosts have no entry with IP address of the container so host blah returns nothing. This is causing various run-time issues in applications that can not find IP address of their own host.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant