Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to automatically detect hostname on boot?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jasonou
Tux's lil' helper
Tux's lil' helper


Joined: 15 Aug 2003
Posts: 87

PostPosted: Thu Aug 28, 2003 3:29 pm    Post subject: how to automatically detect hostname on boot? Reply with quote

I've searched the forums for 'hostname', but noone seems to have this problem. Back when I didn't know about gentoo and used Mandrake, on boot my machine would automatically detect my hostname and the login would say something like "welcome to jones-1125.jones.rice.edu" With gentoo, it seems you setup your own hostname in /etc/hostname. How can I have dhcp automatically detect my hostname (it changes every once in a while, and i need it for ssh at college)? thanks!
Back to top
View user's profile Send private message
GentooBox
Veteran
Veteran


Joined: 22 Jun 2003
Posts: 1168
Location: Denmark

PostPosted: Thu Aug 28, 2003 4:03 pm    Post subject: Reply with quote

Well...

hostname is your computer name.

if you set your hostname to "LulaTheBabe"
and then:

Code:

ping -c3 LulaTheBabe


then you will have a ping reply.
The hostname only works on a local Lan or if you are on the same network as the hostname.

I think you mean a "hostname" like:

0x50a06ef0.naenxx4.adsl-dhcp.tele.dk

(got that hostname from www.myip.dk)

thats your "account" on the ISP´s server right now, you get another "account" then your ip changes (or am i wrong ?)

if you have to ssh into your computer on your college, then you could get a DNS to the college´s external ip, but then port 22 have to be forwardet to your computer.
_________________
Encrypt, lock up everything and duct tape the rest
Back to top
View user's profile Send private message
jufoa
Apprentice
Apprentice


Joined: 10 Dec 2002
Posts: 213
Location: Rovaniemi, Finland

PostPosted: Thu Aug 28, 2003 4:19 pm    Post subject: Reply with quote

you have to set -H parameter to the dhcp on /etc/conf.d/net file.

there should be line like this
#dhcpcd_eth0=""

change it to look like this
dhcpcd_eth0="-H"
Back to top
View user's profile Send private message
jasonou
Tux's lil' helper
Tux's lil' helper


Joined: 15 Aug 2003
Posts: 87

PostPosted: Thu Aug 28, 2003 8:59 pm    Post subject: Reply with quote

thanks jufoa, that's what i wanted ... quick question, is that info stored in a variable somewhere? (besides coming up at the display manager)
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Fri Aug 29, 2003 8:57 am    Post subject: Reply with quote

At least the data is in /etc/dhcpc/eth0.info (replace eth0 with whatever your network interface is called).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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