0

I'm trying to map a hostname to a ip address on a lxc container because the hostname will not be resolvable by DNS.

The lxc.conf of the container contains lxc.mount.entry = /sas/mycontainer/etc/hosts etc/hosts none ro,bind 0 0. Insinde the hosts file I have my ip-hostname mapping: 192.168.0.3 foo.derp

To test the setup I ran lxc-attach -n mycontainer -- openssl s_client -connect foo.derp:636 which returns

gethostbyname failure
connect:errno=0

I also tried to configure the mapping on the lxc host.

1 Answer 1

0

I had to add /etc/nsswitch.conf to the container with a hosts: files dns line.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .