Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/hosts and /etc/hostname
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
smtanner
Tux's lil' helper
Tux's lil' helper


Joined: 12 May 2002
Posts: 106
Location: Colorado

PostPosted: Sat Aug 17, 2002 2:19 am    Post subject: /etc/hosts and /etc/hostname Reply with quote

I have a question about setting up these two files. Right now the only thing in /etc/hosts is:

127.0.0.1 localhost

I put localhost in /etc/hostname and this setup seems to work fine, but I want to name my computer. If I change /etc/hostname to <name>, what do I put in /etc/hosts. I don't know my IP address since I connect through a dhcp server. Can I put a second loopback address in /etc/hosts? If so what would the ip be?

If this question doesn't make sense it's because I don't really understand this stuff right now.
Back to top
View user's profile Send private message
sa
Guru
Guru


Joined: 10 Jun 2002
Posts: 450

PostPosted: Sat Aug 17, 2002 5:01 am    Post subject: Reply with quote

you can add more stuff to /etc/hosts
mine looks like:
127.0.0.1 localhost
11.0.0.2 f.l f
11.0.0.1 c8.l c8
#...
you need to keep the localhost part to keep things running smoothly,
but the other entrys are so you could type "ssh f" instead of "ssh 11.0.0.2"

try "man hosts" for more info

edit: sorry I didnt notice you were using dhcp. I'm not sure how that works:-P, you can add an entry "127.0.0.1 myboxname" but if you type "ssh myboxname" you will connect through the lo, not your real ip address. you can probaly find a script that will make a new /etc/hosts for you every time you start dhcp, mabey someone else can help you with this.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum