Debian – resolv.conf “search” ignored

debiandomain-name-systemresolv.conf

my /etc/resolv.conf file is quite basic, something like:

# Generated by NetworkManager
domain subdomain.example.org
search subdomain.example.org
nameserver 192.0.2.100
nameserver 192.0.2.200

From what I understand, if I have a computer, say machine1.subdomain.example.org, the search field allows me to access it only using its name machine1. But Here's what I get:

$ ping machine1
ping: unknown host machine1
$ ping machine1.subdomain.example.org
PING machine1.subdomain.example.org (192.0.2.12) 56(84) bytes of data.
.../...

I'm on Debian wheezy, how can I make the search directive taken into account for name resolution? Is this a configurations issue? What parameters do I have to check?

EDIT:
Here's the content of /etc/nsswitch.conf as requested:

# /etc/nsswitch.conf                                                        
#                                                                           
# Example configuration of GNU Name Service Switch functionality.           
# If you have the `glibc-doc-reference' and `info' packages installed, try: 
# `info libc "Name Service Switch"' for information about this file.        

passwd:         compat                                                      
group:          compat                                                      
shadow:         compat                                                      

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4             
networks:       files                                                       

protocols:      db files                                                    
services:       db files                                                    
ethers:         db files                                                    
rpc:            db files                                                    

netgroup:       nis                                                         

Best Answer

I would remove network-manager and resolvconf and try again, verify that /etc/resolv.conf still has the right contents. These two packages don't have a place on servers and are known to mess with network and dns configurations when you least want it. I use --purge to fully erase them, leave it out if you want. You may also want to verify /etc/network/interfaces is still correct after removing those packages and perhaps restart networking.

apt-get --purge remove network-manager resolvconf