I have a virtual server running Debian Squeeze. I can change the hostname by running the hostname new.host.name command or by editing /etc/hostname and then running /etc/init.d/hostname.sh, but after a reboot the hostname will be reset to the preconfigured hostname chosen by the server-hoster.
I've already tried changing the hostname by editing both:
/etc/hostname
/etc/hosts
However when I try to use sudo it doesn't work. I have to restart the computer to make sudo work again.
I used hostname NEWHOSTNAME and set a new hostname. Then I restarted, and tried accessing the internet and nothing happened.
I'm making some large-scale system hostname changes and this got me thinking...
going step by step through the hostname bit of the startx script, it appears that, with a random hostname, `hostname -f` hangs indefinitely. Setting this simply to `hostname`lets X start up without a hiccup, but it does seem to interfere with sudo to some extent. I attempted to run netcfg (and I have the appropriate 'NOPASSWD' line in my sudoers file), and it asked me for my password.
I want to change the hostname of my computer. I can do it by editing (as root) the files /etc/hostname and /etc/hosts (unless I missed some other important place). But that's ugly. Is there a straightforward way to do it? (The hostname command only modifies your home directory.)
This would be a useful addition to System Settings.
When I try to edit my /etc/hostname file, using: sudo nano /etc/hostname (or any other editor) I get the following: Error writing /etc/hostname: Permission denied
I then tried to: sudo chmod u+w ./hostname
and got the error:
chmod: changing permissions of `./hostname': Operation not permitted
I get the same error trying to add write permissions to any use or group.
This is what ls show:
-rw-r--r
How do you propagate changes to your hostname from your Linux machine (I am using Linux Mint 13) to your router (I am using DG834Gv2)?
I changed the hostname in /etc/hostname and restarted. The router still resolves the old hostname to my IP address.
Thanks.
The problem is that I fail to SSH to remote machine via hostname(while IP does)
The hostname return by command hostname is : california_desert
While the name returned by command nslookup $IP_address is: pcpp3238782
They did not match each other.
I think that's why I cannot connect to remote machine via hostname.
Checked with /etc/hosts;/etc/hostname; /etc/sysconfig/network; all set hostname t