New on LowEndTalk? Please Register and read our Community Rules.
Does OvZ overwrite /etc/hosts?

I have an OvZ VPS. There's three IPs (venet0:0 through venet0:2).
I want the VPS's hostname to be the IP associated with venet0:2
So I change /etc/hosts, remove the venet0:0 IP, and put an entry for venet0:2
But when I reboot, I get:
# Auto-generated hostname. Please do not remove this comment.
And the venet0:0 hostname is back.
This is CentOS. There's no dhcp in the the ifcfg-eth* scripts, a grep -R for "Auto-generated" in /etc didn't show anything...
Is this something that OvZ does outside the container?
If so, is the best course of action to have a local init script that replaces /etc/hosts at the end of startup with what I want?
Comments
Yup that's OpenVZ, lock the file so it can't be changed on reboot.
chattr +i /etc/hosts
@raindog308 What about adding A IP pointer DNS record? (Doing it the proper way.)
@Janevski this is not directly related, read what he is trying to do and understand we are referring to the host name. Not necessarily having any thing to do with the DNS as there are quite a few services which broadcast this name irrespective of your zone records. Man /etc/hosts if you don't understand. Or setup a fully working MTA in flavors of Postfix, Qmail, and Exim within an hour that are all properly configured and passing full PCI compliance.
@raindog308 just use a start up file, it isn't worth messing with in any unreliable way when the change is by and large immediate.
@natestamm Since i am quite bored enough at this moment and thus not willing to spend time and explain what i have installed and configured so far and how things are working by rule, let me answer You with the following video:

@Janevski
DNS, it is still widely used for:
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
*curl_setopt($ch, CURLOPT_URL, 'http://google.com');
Guys, this really has nothing to do with DNS :-)
Just trying to control which IP cPanel/WHM picks up as the host's IP.
This. Ok I'll stop.
Change it within Solus maybe? "Set as Main IP Address"
Yep, @Francisco pointed out that's the easiest route.
I remember a thread on WHT about this. The OP thought that it was SolusVM, but it must have been OpenVZ that changed the files, not just /etc/hosts. Check out posts 6 and 11 for details about which files are altered.
http://www.webhostingtalk.com/showthread.php?t=1213133