View previous topic :: View next topic |
Author |
Message |
jasonou Tux's lil' helper
Joined: 15 Aug 2003 Posts: 87
|
Posted: Thu Aug 28, 2003 3:29 pm Post subject: how to automatically detect hostname on boot? |
|
|
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 |
|
|
GentooBox Veteran
Joined: 22 Jun 2003 Posts: 1168 Location: Denmark
|
Posted: Thu Aug 28, 2003 4:03 pm Post subject: |
|
|
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 |
|
|
jufoa Apprentice
Joined: 10 Dec 2002 Posts: 213 Location: Rovaniemi, Finland
|
Posted: Thu Aug 28, 2003 4:19 pm Post subject: |
|
|
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 |
|
|
jasonou Tux's lil' helper
Joined: 15 Aug 2003 Posts: 87
|
Posted: Thu Aug 28, 2003 8:59 pm Post subject: |
|
|
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 |
|
|
Janne Pikkarainen Veteran
Joined: 29 Jul 2003 Posts: 1143 Location: Helsinki, Finland
|
Posted: Fri Aug 29, 2003 8:57 am Post subject: |
|
|
At least the data is in /etc/dhcpc/eth0.info (replace eth0 with whatever your network interface is called). |
|
Back to top |
|
|
|