Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

closed as off topic by Bryan, Magellan, Iain Nov 25 '12 at 15:16

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

4 Answers 4

up vote 0 down vote accepted

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.

share|improve this answer
    
This blog post describes it in more detail. Simple fix, everything works. blog.edwards-research.com/2009/09/… –  projectshave Mar 28 '10 at 14:24

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

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

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).

share|improve this answer

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;
share|improve this answer

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