Article ID: 117210, created on Sep 11, 2013, last review on Apr 25, 2014

  • Applies to:
  • Virtuozzo
  • Virtuozzo containers for Linux
  • Virtuozzo hypervisor

Symptoms

Any non-existing hostname is resolved to the local IP address.

    [root@ct ~]# telnet fdsfsdfdsfsd
    Trying 10.20.30.40...
    telnet: connect to address 10.20.30.40: Connection refused

    [root@ct  ~]# ping fdsfsdfdsfsd
    PING fdsfsdfdsfsd.myserver.tld (10.20.30.40) 56(84) bytes of data.
    64 bytes from ct.myserver.tld (10.20.30.40): icmp_seq=1 ttl=64 time=0.026 ms
    64 bytes from ct.myserver.tld (10.20.30.40): icmp_seq=2 ttl=64 time=0.028 ms
    ^C

CT has the following settings:

    hostname=ct.myserver.tld
    ip=10.20.30.40

Cause

This behavior is provided by "search domain" settings in Linux machines. As you can see from ping output - it tries to reach "fdsfsdfdsfsd.myserver.tld" when you ping fdsfsdfdsfsd. Domain suffix myserver.tld correctly resolves to the local host, and, in result, ping goes to the same machine.

Resolution

Double-check the search domain settings. You can explicitly set search domain to "localdomain" to avoid such behavior:

    [root@ct ~]# grep ^search /etc/resolv.conf
    search localdomain

Search Words

resolves to its own ip

dns

ping

search domain

telnet

local IP

a26b38f94253cdfbf1028d72cf3a498b 2897d76d56d2010f4e3a28f864d69223 d02f9caf3e11b191a38179103495106f e8e50b42231236b82df27684e7ec0beb 0dd5b9380c7d4884d77587f3eb0fa8ef

Email subscription for changes to this article
Save as PDF