Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm setting up DNS using bind9 on one of my Ubuntu (12.10) boxes under my home network because my router doesn't support DD-WRT or its own DNS.

I set up a zone for "" with an A record for and have it pointing to (the statically-assigned ip of the machine in question).

I want to be able to access (via HTTP/browser, mainly) this machine by just using http://test/, without having to type in the portion.

I have everything else correctly configured, because I can successfully access and get the correct Apache response, but I cannot find any particular setting that would allow me to access just http://test/.

Here is my named.conf.local file

zone "" {
        type master;
        file "/etc/bind/";

zone "" {
        type master;
        file "/etc/bind/db.192";

and my zone file

; BIND data file for local
$TTL    604800
@       IN      SOA (
                     2013052603         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
        IN      A
@       IN      NS
@       IN      A
@       IN      AAAA    ::1
ns      IN      A
test    IN      A
share|improve this question
up vote 1 down vote accepted

To refer to a host using short hostnames rather than fully qualified domain names, you simply configure the resolver on your client to search a default domain. On Unix/Linux clients, you do that by putting


in your /etc/resolv.conf file.

Note that resolv.conf is frequently automatically managed by DHCP or by your operating system's network configuration (/etc/network/interfaces or NetworkManager). If that is the case, any changes you make to /etc/resolv.conf may be overwritten.

share|improve this answer
well, this certainly worked. However, the main purpose for this is to get the machine accessible for my ipad/iphone. My Windows machines definitely worked due to netbios (though Ive disabled that to test this). I guess I would have to figure out what @Cha0s said in having the DHCP from my router push the domain down to the machines that I can't manually set a search domain for – Thomas Jones May 26 '13 at 17:47
iOS lets you override the Search Domains for your Wi-Fi interface, even when you use DHCP. That's the quick solution. The "right" solution might be to get a proper access point that lets you set DHCP options. – 200_success May 27 '13 at 0:38
Wow. So it does. Somehow I had missed that setting completely. You're right though, that the "right" answer is to get a proper access point. That way I don't have to do any particular manual setup for future machines. – Thomas Jones May 27 '13 at 6:22

This is actually an issue with your DHCP setup.

You need to configure dd-wrt's DHCP Server to push the domain to the clients.

That way when you try to access http://test/ the dns lookup that the client does is for

If you have clients with static IPs then you need to configure the search domain to in their dns client settings.

share|improve this answer
My router serves as my DHCP (though I might end up changing that to my DNS machine as well, if I have to), and doesnt support DD-WRT (its rather old, but does everything that I need it to until now). Not sure if I can push down the domain – Thomas Jones May 26 '13 at 17:49
My mistake, I thought your router was running dd-wrt. Which router do you have? If you setup DHCP on your pc, for ISC DHCP Server the options you are looking for are option domain-name and option domain-search – Cha0s May 26 '13 at 18:04
its a netgear wgr614v9. There's only a checkbox in the config for "use router as DHCP" – Thomas Jones May 26 '13 at 18:20
You can set the domain on the 'Basic ISP Settings' page according to the documentation:… – Cha0s May 26 '13 at 18:25

Your Answer


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.