View previous topic :: View next topic |
Author |
Message |
mlybarger Guru
Joined: 04 Sep 2002 Posts: 473
|
Posted: Sat Mar 21, 2015 6:12 pm Post subject: bind hostname to ip address |
|
|
my hostname is set
Quote: |
mark@lightning ~/Downloads $ cat /etc/conf.d/hostname
# Set to the hostname of this machine
hostname="lightning"
mark@lightning ~/Downloads $ hostname
lightning
|
but i can't ping that hostname:
Quote: |
mark@lightning ~/Downloads $ ping lightning
ping: unknown host lightning
|
my ip address is obtained from dhcp from my wifi router, so it can change. id' rather not put something into /etc/hosts to hack it to work temporarially. how do i get this hostname recognized? |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9677 Location: almost Mile High in the USA
|
Posted: Sat Mar 21, 2015 6:33 pm Post subject: |
|
|
This is completely dependent on your router's DHCP/DNS caching server... The most that your Linux box can do is make sure that your DHCP client sends out a name along with the DHCP request, and if the router DHCP/DNS server doesn't honor it, you're SOL and need to find another solution. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3131
|
Posted: Sun Mar 22, 2015 9:48 am Post subject: |
|
|
Yeah, export to DNS, a line in /etc/hosts, and finaly avahi (distributed, multicast DNS). 3 ways to get it done, which one is good for you depends completly on your setup |
|
Back to top |
|
|
mlybarger Guru
Joined: 04 Sep 2002 Posts: 473
|
Posted: Tue Mar 24, 2015 12:43 pm Post subject: |
|
|
thanks for the insights. i ended up going with a "static" ip address from the router (dhcp server) and putting it into /etc/hosts. |
|
Back to top |
|
|
|