Ubuntu Server Setup
Lección 2 de 5 · Ubuntu Server 14.04 Setup Part 2 – Change Hostname · TI y software
Ubuntu Server 14.04 Setup Part 2 – Change Hostname
hey guys welcome to part 2 of my boom to server setup series in this video we're just going to run a couple maintenance tasks that I like to do after any boom –
installation alright so the first thing I want to do is I want to change the hostname for our server alright so I'm going to go ahead and log in with look want to log in with the credentials that
I created when we did the installation now I'm running this in a virtual machine but log in and correct oh okay alright so logged in now like I said if you are using a server an actual
machine and not using VMware or any virtualization that's absolutely fine pretty much everything we do in this series it doesn't really matter if it's a virtual machine or not alright so
let's go ahead and change the hostname by default you can see that my command prompts has Brad at bun 2 or boom – so the hostname right now is a bun – ok so we want to change that and there's two
different places that we want to change that ok so I'm going to say sudo which basically sudo allows you to run commands as root okay as the root user and there's just a lot of different
things that you need to you need to access as a root user so you'll be seeing sudo quite a bit all right and the editor that I like to use is Nano alright so it's kind of a newbie
editor it's really easy to use and that's why I like it I know some of the hard core Linux geeks like VI or vim but I think Nano is the easiest to use so that's what I like feel free to use any
editor that you'd like alright now the file I want to edit is in the e.t.c directory which is basically all the configurations for your system alright and then the hosts file
and when you log in when you when you run a command as sudo it's going to ask you for your password which I keep typing in the wrong one alright so you can see we have our
localhost with our loopback IP and then we have this 1 2 7 0 1 1 and we have a boom tool we want to change this thing and I just call this test server okay now to to get
out of here we want to do a control X and then it's going to ask if we want to save so we're just going to hit Y and then enter ok brings us out and now that's saved all
right now there's one other place we want to change our hostname all right now I'm just going to hit the up arrow which brings us to our last command and the file we want to access is hostname
okay it's an ET c / hostname all right and we just want to change it here as well okay control X and get out of here alright so now we want to restart the
networking service alright so I'm going to say sudo et Cie in it d / networking space restart all right now you're going to get this message here unable to resolve host
Ubuntu because we have to do a server reboot in order for everything to take effect so we're just going to say sudo reboot all right so we rebooted and now you can
see it says test server login so that's our hostname has changed all right and we can even type in hostname and that shows us that it's changed to test server alright so in the next video what
we're going to do is we're going to assign a static IP address to the server and we're also going to add in our DNS name servers
Simple steps to changing an Ubuntu server hostname using the command line
Sorry guys I didnt realize some was cut off. Here are the commands you cant see
sudo nano /etc/hostname
sudo /etc/init.d/networking restart
sudo reboot