/etc/hosts and bridged network

jburleson

Renowned Member
Apr 29, 2008
31
0
71
Jonesboro, AR
Not necessarily a bug, but I thought I would post this for others.

I created a vz container first without using a bridged network. When the container was created the hosts file was correctly created listing the ip address and the hostname I assigned to the container.

Later I reconfigure the container to use a bridged network and the hosts file was not updated to reflect the new ip address I assigned to the container. I did not change the hostname so I'm not sure if that would have caused it to re-write the hosts file or not. While this did not cause any trouble with connectivity, programs that read the hosts file will not get the correct information.

I manually editing the hosts file to reflect the correct ip address and then restarted the container to make sure that it was not reset. It was not.

As I mentioned at the beginning I do not think this is a bug, but I wanted to confirm that manually editing the hosts file on a bridged network is the correct think to do.
 
As I mentioned at the beginning I do not think this is a bug, but I wanted to confirm that manually editing the hosts file on a bridged network is the correct think to do.

Yes, I think thats the way. Its a bit clumsy, but we do not have any information about Guest IP/NET inside the host, so we can't do better.

- Dietmar