Thanks for the answers you guys!
It was the nsswitch.conf file. I had setup LDAP from a tutorial that told me to use this line in hosts:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4When I changed it to this:
hosts: files dns mdns4_minimal [NOTFOUND=return] mdns4It works without a problem. So I guess the nsswitch config file was making it return null if not found in files or mdns4_minimal, right?