0

I want to access services on other machines on my home network with just their hostname. In every browser, http://machine fails, but adding a period in http://machine./ works. Is there a way to avoid adding that extra period?

My setup is a router with DD-WRT w/ DNSmasq turned on, Win7 machines and several Ubuntu VMs. nslookup works fine with just hostname. Remote desktop works, but TightVNC needs the extra period. ssh needs the period. As I said, all my browsers need the extra period.

I'd prefer a solution that doesn't require manually maintaining the hosts file. Thanks.

4 Answers 4

1

Windows doesn't lookup single-labelled domains using DNS by default, it uses WINS.

I posted about this somewhere else, but I can't find the answer now. The workaround I found was to add a single domain "." in the list of DNS suffix entries in the system's network settings.

2
1

Does it have to be by name? Quick and easy to use IP address.

3
  • Yes, by name. I've got non-technical people in my house. And I can't remember more than 3 digits anyway. Mar 26, 2010 at 15:11
  • Why the downvote? How many total hosts are thre?
    – Dave M
    Mar 26, 2010 at 18:30
  • I didn't downvote. Mar 27, 2010 at 4:14
0

Do you have a domain name? That's what the problem here is; the machine doesn't know where to look until you tell it that it's .nuthin

If not, dnsmasq has a couple of options. You can set up ALIAS (CNAME) records to point the name to the A record (which defaults to A.domain.tld, which is probably your problem). If your router has a "hosts" file, you can add the hosts there, and it should pick them up (make sure you do 10.1.1.2 host host.domain.tld, so it'll know that host = host.domain.tld).

0

How about an automated way of editing/maintaining the hosts files.
Run this from cron on a linux host and distribute it to all machines automatically.
(or write the windows equivalent in powershell or whatever)

rm -rf /etc/host.new;
arp -a | while read line ;do 
  echo $line | cut -d " " -f 1,2 | sed s'/(//'g | sed s'/)//'g >> /etc/host.new;
done 
# cat /etc/host.new >> /etc/hosts;

Not the answer you're looking for? Browse other questions tagged or ask your own question.