[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh on lan by hostname instead of dynamic ip



Chris Lale wrote:
BartlebyScrivener wrote:
Hello,

I use unison and rsync on my home LAN. Everything works fine as long
as I use ip addresses, for example,

ssh rick@192.168.0.5

But my router (on home LAN) assigns dynamic ip addresses. So my
scripts don't work if the router happens to assign a different address
that day to one of my machines.

Is there a way to use ssh and rsync using hostname instead of ip
address. It seems to me I've had this working once or twice, but then
it stops.


Not sure if dnsmasq[1] might help - it can serve the names of local machines
which are not in the global DNS. I've looked at it but never actually used it
myself.

[1] http://www.thekelleys.org.uk/dnsmasq/doc.html



If you'd rather not set up dnsmasq or need something quicker ;) you may be able to set the router to assign the same IP to the system using the MAC address. I have a DLink that allows this. You then put the IP and host name in your /etc/hosts file.

From what I can see in the man page for dnsmasq, it would basically do the same thing as the above, it just puts the configuration onto your local server rather than the router (my guess;-)

--
Bob McGowan

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Reply to: