Jump to content
Sign in to follow this  
richie

super noob

Recommended Posts

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

 

su -

 

edit the hosts file

 

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:-

 

192.168.0.123 myhostname

 

where 192.168.0.123is your ip address

 

save the file

 

:wq

 

that should do it

i hope !

Share this post


Link to post
Share on other sites

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:

su -

 

For a temporary change (until next reboot)

# hostname my.site.com

 

For perm changes:

 

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

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

 

Gentoo

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

 

Redhat (I assume Fedora therefore)

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

 

Slackware

vi /etc/HOSTNAME
myhostname.example.com

 

I wish they were all just one line ^_^

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...