[clue-tech] ProxMox /etc/hosts
David L. Anselmi
anselmi at anselmi.us
Mon May 31 13:10:37 MDT 2010
mike havlicek wrote:
> Anyway I am a little uncomfortable with giving in to my urge to change
> what I believe to be the default entries I got in /etc/hosts:
> 127.0.0.1 localhost
> 127.0.1.1 enik.home.sleestaks.net enik
> #192.168.1.16 enik.home.sleestaks.net enik
>
> What does the 127.0.1.1 entry do in the scheme of ProxMox VE as I am not
> versed in this product....
All the hosts file does is map names to IPs. Your resolver libraries (that sometimes talk to DNS to
do name resolutions) also know to look in the hosts file.
The 127/8 subnet is part of your loopback network interface. So all the addresses in there behave
the same (but not all are typically used). So from the above it looks like you might have some
services running on 127.0.0.1 and some on 127.0.1.1. Your hosts file gives those two addresses
different names (and if you swap them things are unlikely to work).
This http://forum.proxmox.com/threads/1340-hosts-file suggests that proxmox has a tool that makes
entries in /etc/hosts, and that the entries correspond to VMs somehow.
You might look at the docs and see what machines can see your /etc/hosts. Probably the physical
machine uses that file to keep track of the VMs it's hosting and they run some service the host can
use to control them.
I doubt that the VMs can see (the physical) /etc/hosts, so probably they don't care what changes you
make.
Assuming enik is the name of the physical machine, it seems odd that proxmox should want to talk to
it on 127.0.1.1 (nothing else is likely to expect the machine's name to map to a loopback address).
Take a look at the docs and experiment to see how creating/removing VMs affects the hosts file.
You shouldn't worry about changing the file (especially if you keep a copy of the original). If you
take out enik, you'll know where it matters when you get errors about not being able to resolve that
name. If you make it a different address then you might get errors about not being able to contact
that host (because the services being tried are on a different address).
If the docs don't spell out what is happening you have to use trial and error (and write a bug,
especially if you can provide a patch).
HTH,
Dave
More information about the clue-tech
mailing list