Home » Linux OS and Software » DNS » resolv.conf
Tue, 26 February 2008 02:32 Go to next message
Registered: February 2008
Messages: 12
When I reboot my VPS, you overwrite my resolv.conf with your preconfigured nameservers. But I run my own nameserver, and want my resolv.conf to look like:

search mydomain.com
nameserver 127.0.0.1

Can you stop overwriting my resolv.conf at reboot?

And /etc/hosts?
And /etc/hostname?
Tue, 26 February 2008 10:35 Go to previous messageGo to next message
Registered: November 2007
Messages: 504
a23d56 wrote on Tue, 26 February 2008 02:32



Can you stop overwriting my resolv.conf at reboot?

And /etc/hosts?
And /etc/hostname?



The OpenVZ system software will rewrite those files on each reboot automatically, we can't change that.

Your hostname is set from our control panel. If you want to change it, change it there.

resolv.conf and hosts can be set by you after boot, usually by placing instructions here /etc/rc.local. That will execute after openvz has reset your files.
Tue, 26 February 2008 10:49 Go to previous messageGo to next message
Registered: February 2008
Messages: 12
Yeah I suppose I can overwrite what you overwrite, at boot time.

As a side point, I always thought /etc/hostname was supposed to be the short name, not the FQDN.

What do you think?
Tue, 26 February 2008 11:29 Go to previous messageGo to next message
Registered: November 2007
Messages: 504
Its the whole enchilada.
Tue, 26 February 2008 11:44 Go to previous messageGo to next message
Registered: February 2008
Messages: 12
That's easy for you to say. Laughing Googling it finds advantages/disadvantages of either method. Here is an interesting link:

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index. jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rins_ho stname.html

I prefer the short name in /etc/hostname, it avoids redundancy between /etc/hostname vs. /etc/hosts. But to use the short name, you need working DNS. Maybe a FQDN /etc/hostname can provide a crutch for those without DNS.
Tue, 26 February 2008 13:48 Go to previous message
Registered: February 2008
Messages: 12
FYI, here's a recipe to override /etc/hosts and /etc/hostname on Debian:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

cat << '@' > /etc/hosts
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
@

cat << '@' > /etc/hostname
curts
@

hostname `cat /etc/hostname`

exit 0

Be sure to change 'curts' to your own hostname

Next Topic:bind9 in Debian VPS
Goto Forum:
  


Current Time: Thu Jun 22 19:59:32 EDT 2017
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2006 FUD Forum Bulletin Board Software