How can I get my home machines to connect to each other via hostname?

3

I've got a standard Linksys router and a few laptops - mix of Windows Vista and Mac OS X. Shouldn't my router act as a DNS server to resolve hostnames for the machines within my local network? If not, how else can I solve this? Static hosts files? Other solutions?

Marplesoft

Posted 2010-03-18T03:41:20.380

Reputation: 477

Answers

2

You have multiple choices to achive this.

  1. Your Linksys router will probably be a DNS proxy to be queried by your local computers for adress resolution from the internet, but not for the local name resolution. You'll probably have the chance to use another image on your router like DD-WRT or something like that, that ships with an DNS-Server for the local net.

  2. Choose one of your machines to be the local DNS-Server, but that requires that machine to run 24/7.

  3. Edit the hosts file on each machine. That will only work if you use static adresses at home, or never expiring leases on your linksys router.

  4. Use Zeroconf, Bonjour or whatever implementation you like to achive this.

Oliver Friedrich

Posted 2010-03-18T03:41:20.380

Reputation: 577

3

To achieve this on my local network I install Apple's Bonjour for Windows on all my windows machines and Avahi on all my linux machines (if it's not on there already, it often is). Then I can access each machine in the Zeroconf ".local" domain. So if a given machine's hostname's "Stan" or "Cartman", I can access those machines at stan.local and cartman.local

Josh

Posted 2010-03-18T03:41:20.380

Reputation: 7 540

Wow, I never knew that. +1 – Ryan C. Thompson – 2010-04-09T19:19:45.367

1

The easiest solution that I have found is to install Tomato. DD-WRT probably works too. If you're also planning on forwarding ports and stuff like that, then you also want to look in the "Static DHCP" section, where you cna instruct your router to always give the same computers the same IP addresses.

Edit: Hopefully you purchased a linux-compatible Linksys router, or else this won't work.

Ryan C. Thompson

Posted 2010-03-18T03:41:20.380

Reputation: 10 085

-1

DNS isn't used for this, SMB is. By default, yes, the machines should be addressable by name automatically. Make sure the workgroup name is set the same on all machines for this to work

Alex

Posted 2010-03-18T03:41:20.380

Reputation: 2 094

1SMB has nothing to do with name resolution. – Oliver Friedrich – 2010-03-18T06:48:30.427

Actually, it does. It's possible to resolve hostnames using Samba. I've never gotten it to work reliably, though, and whenever it doesn't work, it takes ages to time out. – Ryan C. Thompson – 2010-03-18T07:12:51.253

1No, it has nothing to do with SMB-protocol. Name resolution used by SMB is implemented in netbios. – Oliver Friedrich – 2010-03-18T08:18:40.537

1@BeowulfOF: You're right, it's NetBIOS -- which runs over TCP/IP. NetBIOS and SMB are linked in my mind because they're used together on Windows, but you're right, one does not require the other. NetBEUI and NetBIOS should not be confused; NetBIOS used to run on NetBEUI but ran on TCP/IP as of Windows 95, IIRC. – Alex – 2010-03-18T18:35:27.050