Debian resolver adds domain and I don’t want that

debiandomain-name-systemresolv.conf

I have the following problem:
if I ping a non existent domain name I get a reply from an IP address
# ping nosuchdomain.common
PING nosuchdomain.common.myrealdomain.com (192.168.1.1) 56(84) bytes of data.
64 bytes from myrealdomain.com (192.168.1.1): icmp_req=1 ttl=59 time=0.184 ms

Anyway, what I would want to happen would be to have the resolver work like this
#ping nosuchdomain.common
ping: unknown host nosuchdomain.common

My /etc/resolv.conf looks like this now:
# nameserver config
nameserver 8.8.8.8

Any idea where I should look to make the resolver return "unknown host"?

Best Answer

Normaly you should end a Domain Name with a dot, if you don't do this your resolver try to attach a search Domain from you network config (for example from DHCP)

Your example with nosuchdomain.common should be written as nosuchdomain.common.

To find out the reason where is set the search domain, you can use a static IP and set a different DNS Server and than you should not get a search domain. You should check you /etc/network/interfaces config for a search-domain parameter:

#/etc/network/interfaces 
# The primary network interface
auto eth0
iface eth0 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 8.8.8.8
    dns-search myrealdomain.com