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

I realize that a trailing dot after a hostname is technically "correct", but it's a pain in the butt to type and is unintuitive for non-technical users. I had DDWRT on a Linksys router of mine many, many years ago, and it resolved local hostnames via dnsmasq without the trailing dot. However, having just installed Tomato onto my Asus N66U, trailing dots are always required. For example, "ping router" doesn't work, but "ping router." does.

Assuming my router's hostname is "router", I'd like dnsmasq to allow me to type "ping router", "http://router/", etc and have it work as expected. Does anyone know how to configure dnsmasq to do so?

Modifying my HOSTS file is not acceptable, and I've shut off NetBIOS over TCP/IP completely (I'm slowly transitioning to a Linux-only network), so that is not an option for numerous reasons. Thanks.

share|improve this question
1  
When you say modifying your hosts file is not acceptable do you mean that modifying it on other computers in your network is unacceptable? DNSMasq some of its settings from the /etc/hosts in certain configurations, so you may need to modify it on the box acting as the DNSMasq server. Though you can do most of the things by configuring DNSMasq as well. –  Zoredache Aug 12 '12 at 5:01

2 Answers 2

up vote 2 down vote accepted

So in your previous setup I suspect your fully qualified domain name was something more then just the bare hostname. Perhaps router.local., or router.lan. or something else like that. With a fully qualified name defined, you could then the DNS search path setting for your network via your DHCP server.

So your routers hostname would be router.local., and your DNS resolvers would have a search patch of local. That when your clients perform a lookup for router, the DNS client will automatically append the .local. and then successfully resolve the address.

If you are using DNSMasq as both your DHCP and DNS server making this happen should be trivial.

share|improve this answer
    
Brilliant! Thanks so much. If you ever need help with web development, feel free to reach out. I'm very grateful. :) –  Eric Aug 12 '12 at 19:25
    
Oh and just to help anyone in the future, all I had to do was add ANYTHING (non-whitespace) to the "Basic" -> "Identification" -> "Domain Name" setting in the Tomato web interface. For reference, I'm using the AIO, 64k nvram version of Shibby's build of Tomato. –  Eric Aug 12 '12 at 19:28

If you found this thread due to a similar problem without using ddwrt, but using dnsmasq on linux and using windows hosts that query it, requiring you to add a "." to make it actually do a dns lookup (mostly a problem with local domains/hostnames for intranet sites or LAN resourses) here is the solution:

For statically assigned addresses you have to add a "." to the "Append these DNS suffixes" under "Advanced TCP/IP Settings". Alternatively you can add a domain name here as well.

For dynamically assigned addresses (DHCP) you have to add a "." to automatically be added to all DNS queries. Similar to the static settings, but in your DHCP server settings.

Hope this helps, there is not much info out there on this problem.

share|improve this answer
    
Very helpful. I found similar posts that didn't ever resolve the issue by including the phrase "trailing dot". So maybe this comment will help those people using the same search I was. –  freb Jan 16 '13 at 20:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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