need to reset host

Asked by Roger Warburton

I have had Major problem and needed a new ubuntu version installed.
An engineer installed ubuntu 9.04 and that has left him as the host.
Tried to delete it but it will only add my choice but it does not delete the original,so when opening the terminal the host is left as him.
This is leading to one of the problems that I solved in the past

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Steven Danna
Solved:
Last query:
Last reply:
Revision history for this message
Steven Danna (ssd7) said :
#1

Do you want to change the hostname? To do this, the following should work:

1) Open a terminal:
2) Run the command: sudo gedit /etc/hostname
3) That file should just contain your hostname. Replace the current hostname with the desired hostname.
4) Save and Close the file.
5) Run the command: sudo gedit /etc/hosts

You will see something like:

127.0.0.1 localhost
127.0.1.1 icky_host_name

at the top of the file. Change the "icky_host_name" to your desired host name.

6) Save and close the file.
7) Run the command: sudo hostname new_host_name (where the new_host_name is the host name you want).
8) Close the terminal.

9) When you open a new terminal your hostname should be the new hostname. Also, when you reboot that hostname should be the new host name.

Revision history for this message
Roger Warburton (r-j-warby) said :
#2

sorry but it wont let me in,it keeps saying that, unable to resolve host

Revision history for this message
Roger Warburton (r-j-warby) said :
#3

now we have this running
sudo: unable to resolve host new_host_name
No protocol specified

(gedit:4761): Gtk-WARNING **: cannot open display: :0.0
roger@new_host_name:~$

Revision history for this message
Shahar Or (mightyiam) said :
#4

Can you be more specific, please?

Please explain:
1. What you are doing.
2. What you expect to happen.
3. What actually happens.

Revision history for this message
Roger Warburton (r-j-warby) said :
#5

I need to change the host as it is not being recognised by the terminal as
the guy who loaded the ubuntu on used his laptop so this machine is mixing
up the hosts
I need to reset the terminal to recognise me as the owner

2009/6/25 Shahar Or <email address hidden>

> Your question #75294 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/75294
>
> Status: Open => Needs information
>
> Shahar Or requested for more information:
> Can you be more specific, please?
>
> Please explain:
> 1. What you are doing.
> 2. What you expect to happen.
> 3. What actually happens.
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+question/75294
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Shahar Or (mightyiam) said :
#6

What do you see when you turn the system on and wait for it to finish loading, please?

Do you see the text console or the graphical login screen?

Revision history for this message
Roger Warburton (r-j-warby) said :
#7

Sorry dont understand your question the ubuntu theme comes up,asking for log
on name and password

2009/6/25 Shahar Or <email address hidden>

> Your question #75294 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/75294
>
> Status: Open => Needs information
>
> Shahar Or requested for more information:
> What do you see when you turn the system on and wait for it to finish
> loading, please?
>
> Do you see the text console or the graphical login screen?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+question/75294
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Roger Warburton (r-j-warby) said :
#8

This is the current operation coming up
sudo: unable to resolve host new_host_name
No protocol specified

(gedit:5953): Gtk-WARNING **: cannot open display: :0.0
roger@new_host_name:~$

2009/6/25 Shahar Or <email address hidden>

> Your question #75294 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/75294
>
> Status: Open => Needs information
>
> Shahar Or requested for more information:
> What do you see when you turn the system on and wait for it to finish
> loading, please?
>
> Do you see the text console or the graphical login screen?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+question/75294
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Best Steven Danna (ssd7) said :
#9

I think that the only problem you are running into now is that the
hostname in /etc/hostname and /etc/hosts are not the same:

Edit /etc/hostname to only contain the hostname you want. Then
edit /etc/hosts to contain:

127.0.0.1 localhost
127.0.1.1 hostname

where hostname is replaced with whatever you put in /etc/hostname.

Those have to be exactly the same. Then run this command:

sudo hostname new_host_name

where new_host_name is exactly the same name you put in the other two
files.

Revision history for this message
Roger Warburton (r-j-warby) said :
#10

Thats cracked it guys thanks to everybody for you essential help

Revision history for this message
Roger Warburton (r-j-warby) said :
#11

Thanks to all