Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 a domain on my home network for learning purposes, using BIND on CentOS to act as the name server. I've got the name server up and running as type master for my internal domain (, and can do forward and reverse lookups from other computers in my LAN. For example, host correctly returns has address

What I'd like is to be able to resolve just office2 to its address, without needing to put at the end.

Is this possible, or even desirable to do? I'm running a mixed environment at home with both Linux and Windows computers.

share|improve this question
up vote 5 down vote accepted

It is possible and perfectly desirable. On the Linux machines:

  1. Add search to your /etc/resolv.conf

On the Windows machines (instructions for Windows XP, other versions will require adaptation but should be similar):

  1. go to Start > Settings > Network Connections
  2. right-click local network connection > Properties
  3. left-click Internet Protocol (TCP/IP)
  4. left-click Properties
  5. left-click Advanced
  6. left-click DNS tab
  7. left-click Append these DNS suffixes
  8. left-click Add
  9. type
  10. left-click Add
  11. left-click OK
  12. left-click OK
  13. left-click OK
share|improve this answer
Ah! So that is what the "search xyz" lines are for. Doy! – Adam Plumb Jun 10 '09 at 15:13

This is a client config issue, not a server config issue. The recommendation to put the domain in the search path in resolv.conf is a client change. You would do the same thing (albeit with a GUI) on Windows or Mac OS X, or in the DHCP scope options of your DHCP server if you're using one.

share|improve this answer
+1 for mentioning DHCP options. I would rather make one change on the DHCP server then on each client machine, even if it is only a few on a home network. – steve.lippert Jun 10 '09 at 16:04

This has to do with your default search domain. This is often pushed out by your DHCP server, or it can be set manually

(My computer | Propterties | Compuer Name | Change | primary domain suffix)

share|improve this answer

Try putting your domain name as a search domain in /etc/resolv.conf, for example:


That should allow you to use hostnames.

share|improve this answer

If the domain exists on the same network then place the following in your /etc/resolv.conf:


You probably want to use domain in favour of search in this instance.

share|improve this answer

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.