You are not logged in.

#1 2008-09-12 23:38:38

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Hostnames with static IPs

I set up a server with the name "raspberrohs".  I edited /etc/rc.conf and /etc/hosts to reflect it.  If I obtain an IP via DHCP, I can access it anywhere on the network by it's name.  But, if I assign the server to an IP (via netcfg2), I can only access it via its IP.  How do I fix this?

Offline

#2 2008-09-12 23:49:15

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Hostnames with static IPs

You need to set it in the router's hosts table too afaik:

root@Zeus:~# uname -a
Linux Zeus 2.4.34 #3 Sun Sep 30 20:33:21 CEST 2007 mips unknown
root@Zeus:~# cat /etc/hosts 
127.0.0.1       localhost.localdomain           localhost
10.0.0.1        zeus.borromini.net              zeus
10.0.0.5        hermes.borromini.net            hermes
10.0.0.3        okeanos.borromini.net           okeanos
10.0.0.10       playstationthree.borromini.net  playstationthree
10.0.0.15       amalthea.borromini.net          amalthea

Almost all my boxen have a static IP over DHCP, the server (amalthea) is the only one having a fully static setup (ie IP not assigned by DHCP), and I can resolve it just fine with this.

Last edited by B (2008-09-12 23:53:21)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2008-09-12 23:55:43

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: Hostnames with static IPs

Ohhhhhh yeah, static IP over DHCP.  I forgot all about that.  I'll do that, thanks a lot smile

Offline

#4 2008-09-13 00:00:59

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: Hostnames with static IPs

How do you use netcfg2 to lease a static IP over DHCP?  I am on a small network at work and I'm not able to change the settings on the router.

Offline

#5 2008-09-13 14:18:21

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Hostnames with static IPs

You don't configure that on the client-side, that needs to be set server-side (on my router in /etc/ethers).


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#6 2008-09-13 17:17:32

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: Hostnames with static IPs

I figured that if the DHCP server registers my hostname, I could take advantage of it.

Offline

Board footer

Powered by FluxBB