Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
super noob
#1

how do i change the name of my computer so that it doesn't read localhost in the command line?

thanks,

rich

Reply
#2
what distro?
Reply
#3

Quote:how do i change the name of my computer so that it doesn't read localhost in the command line?thanks,

rich
 

login as root

 



Code:
su -




 

edit the hosts file

 



Code:
vi /etc/hosts




 

do not change the line listed as 127.0.0.1 localhost.localdomain localhost

 

but add a line which is as follows:-

 



Code:
192.168.0.123 myhostname




 

where 192.168.0.123is your ip address

 

save the file

 



Code:
:wq




 

that should do it

i hope !

Reply
#4

Ok first up.. where I use "vi", replace that with the editor that you are comfortable with for instance "gedit" is quite easy to use. Also all of this should be done as "root"...

 

Become root:



Code:
su -




 

For a temporary change (until next reboot)



Code:
# hostname my.site.com




 

For perm changes:

 

ALL the SYSTEMS! (use your IP.. it might not be what I put here)



Code:
# vi /etc/hosts
192.168.1.1 my.site.com  my




 

Gentoo



Code:
# vi /etc/conf.d/hostname
HOSTNAME="my"
# vi /etc/conf.d/domainname
DNSDOMAIN="site.com"




 

Redhat (I assume Fedora therefore)



Code:
# vi /etc/sysconfig/network
HOSTNAME=my.site.com




 

Slackware



Code:
vi /etc/HOSTNAME
myhostname.example.com




 

I wish they were all just one line :)

Reply
#5

WOWWW! thanks. i got that done. i'm using ubuntu and i can connect to some websites but other, yahoo, google, etc always get hung up. i think it's a firewall thing but i don't know the name of my firewall, ubuntu asked if i wanted it enabled and i said yes, or how to gain access to it. any ideas.

thanks,

rich

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)