Cambiar el nombre del equipo
Para cambiar el nombre del equipo:
A través de la consola:
Primero entra en la consola terminal ( Menú Aplicaciones -> Accesorios -> Terminal)
Ahí ejecutas el comando:
sudo nano /etc/hostname
Nano es un potente editor de texto para linea de comando y muy liviano, podrías utilizar también gedit que es un editor gráfico, pero recomiendo más el nano porque se aprende mucho cuando algún día encuentres un equipo que no puede utilizar algún ambiente gráfico |
Te pedirá la contraseña para usar el comando sudo.
Luego cambias el nombre del equipo definido en el archivo hostname que ya lo tienes abierto. Para salir de nano utilizas las teclas Control + X, te pregunta si quieres guardar le digitas S y luego Enter para que use el mismo nombre de archivo y sobreescriba el anterior.
Edita de la misma forma el archivo /etc/hosts.
Es posible que necesites cerrar la sesión y volverla abrir para que los cambios tengan efecto en el X. De lo contrario, al ejecutar comandos como gksu o kdesu pueden no funcionar debido a que el cambio de configuración del sistema no se ha hecho efectivo en esas aplicaciones. |
Listo!!!!
Change Ubuntu Server from DHCP to a Static IP Address
If the Ubuntu Server installer has set your server to use DHCP, you will want to change it to a static IP address so that people can actually use it.
Changing this setting without a GUI will require some text editing, but that’s classic linux, right?
Let’s open up the /etc/network/interfaces file. I’m going to use vi, but you can choose a different editor
sudo vi /etc/network/interfaces
For the primary interface, which is usually eth0, you will see these lines:
auto eth0
iface eth0 inet dhcp
As you can see, it’s using DHCP right now. We are going to change dhcp to static, and then there are a number of options that should be added below it. Obviously you’d customize this to your network.
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
Now we’ll need to add in the DNS settings by editing the resolv.conf file:
sudo vi /etc/resolv.conf
On the line ‘name server xxx.xxx.xxx.xxx’ replace the x with the IP of your name server. (You can do ifconfig /all to find out what they are)
You need to also remove the dhcp client for this to stick (thanks to Peter for noticing). You might need to remove dhcp-client3 instead.
sudo apt-get remove dhcp-client
Now we’ll just need to restart the networking components:
sudo /etc/init.d/networking restart
Ping http://www.google.com. If you get a response, name resolution is working(unless of course if google is in your hosts file).
Really pretty simple.
Updated Thanks to Nickname007 in the comments for noting that I forgot the DNS entries in the guide.
Fuentes:
http://www.guia-ubuntu.com/index.php?title=Cambiar_el_nombre_del_equipo
http://www.howtogeek.com/howto/ubuntu/change-ubuntu-server-from-dhcp-to-a-static-ip-address/