Strange problem with local name resolution - Debian

This is a discussion on Strange problem with local name resolution - Debian ; Hi everybody, after installing some brand new Sarge systems I've been facing a strange problem concerning the resolution of local(!) hostnames. It's a very common situation: I've got two fresh sarge boxes connected to the internet as usual. Say, the ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Strange problem with local name resolution

  1. Strange problem with local name resolution

    Hi everybody,

    after installing some brand new Sarge systems I've been facing a strange
    problem concerning the resolution of local(!) hostnames.

    It's a very common situation:

    I've got two fresh sarge boxes connected to the internet as usual. Say,
    the have the IPs 123.456.789.123 and 123.456.789.456.

    Additional, the servers are connected to each other over a second
    network interface with local addresses 192.168.0.100 and 192.168.0.101.

    In the /etc/hosts files (on each machine) there are the following
    entries:

    **************************************************
    127.0.0.1 localhost

    192.168.0.100 box1.mylocalnetwork.loc box1
    192.168.0.101 box2.mylocalnetwork.loc box2

    123.456.789.123 www.somename.net www
    123.456.789.456 data.somename.net data
    **************************************************

    Well, and here's the problem. Being logged-in on box2, the command:

    `host 192.168.0.100`

    results in: "Host 192.168.0.100 not found: 3(NXDOMAIN)"

    and also

    `host box1.mylocalnetwork.loc`

    results in: "Host box1.mylocalnetwork.loc not found: 3(NXDOMAIN)"

    The STRANGE thing (I belive it's dark magic) is that the name resolution
    works fine for apt-get (ftp). I have a local debian mirror on box1, and
    my /etc/apt/sources.list (on box2) has the name (not the IPs!) of
    box1.mylocalnetwork.loc as debian ftp source. And it works! But it
    doesn't for mysql (slave tries to connect for replication - this
    fails).

    Some additional information about what I've done to solve the problem:

    - Checked /etc/resolv.conf
    search mylocalnetwork.loc somename.net
    nameserver xxx.xxx.xxx.xxx
    (of course it's a valid nameserver IP)

    - Checked /etc/nsswitch.conf
    hosts: files dns
    networks: files

    - Checked /etc/hosts
    (see above)

    - Did `strace -vf -o /tmp/straceout getent hosts box1`. Result:
    "192.168.0.100 box1.mylocalnet.loc box1"

    - Checked network configuration, ok.

    Note: there is NO problem connection to the machines by IP addresses.
    There is NO problem resolving arbitrary hostnames in the public world
    (e.g. www.yahoo.com).

    What's going on there?

    Thanks in advance for any hint.

    Best regards,
    Andreas

    --
    procommerz - Internet fuer Unternehmen
    www.procommerz.de | 033925-90710

    Öffentlicher GnuPG-Schlüssel / public GnuPG key:
    http://www.procommerz.de/standort/avent_pub_key.gpg

  2. Re: Strange problem with local name resolution

    On Sun, Oct 09, 2005 at 04:56:17PM +0200, Andreas Vent-Schmidt wrote:
    > after installing some brand new Sarge systems I've been facing a strange
    > problem concerning the resolution of local(!) hostnames.


    [trim]
    > `host 192.168.0.100`


    > results in: "Host 192.168.0.100 not found: 3(NXDOMAIN)"


    The 'host' utility doesn't use /etc/hosts, only DNS. It snarfs DNS
    serves from /etc/resolv.conf so you don't actually _realise_ it's doing
    this, unless you try to 'host' something that exists only in /etc/hosts
    or some other non-DNS hosts database.

    --
    -----------------------------------------------------------
    Paul "TBBle" Hampson, MCSE
    8th year CompSci/Asian Studies student, ANU
    The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
    Paul.Hampson@Anu.edu.au

    "No survivors? Then where do the stories come from I wonder?"
    -- Capt. Jack Sparrow, "Pirates of the Caribbean"

    License: http://creativecommons.org/licenses/by/2.1/au/
    -----------------------------------------------------------

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (GNU/Linux)

    iD8DBQFDSTdXexDuohKLFuARAn18AKDE+0S87Z7420zxlSFrAO 2wQQ4NeACgzGjF
    +5kVhuVLNxRNWHLZ3iJrHIw=
    =zm/5
    -----END PGP SIGNATURE-----


  3. Re: Strange problem with local name resolution

    Hi Paul,

    thank you very much for your useful help.

    Well, I've read some excellent books on linux administration, but can't
    remember that this fact would ever had been mentioned...
    (hope this English sentence is nearly correct ;-)

    Now knowing this behavior of the host command, I *will* find the actual
    cause why mysql can't connect...

    Thanks again and have a good week!
    Andreas

    Am Sonntag, 9. Oktober 2005 17:29 schrieb Paul TBBle Hampson:
    >
    > The 'host' utility doesn't use /etc/hosts, only DNS. It snarfs DNS


    --
    procommerz - Internet fuer Unternehmen
    www.procommerz.de | 033925-90710

    Öffentlicher GPG-Schlüssel unter:
    http://www.procommerz.de/standort/avent_pub_key.gpg

  4. Re: Strange problem with local name resolution

    Andreas Vent-Schmidt said:
    > Hi Paul,
    >
    > thank you very much for your useful help.
    >
    > Well, I've read some excellent books on linux administration, but can't
    > remember that this fact would ever had been mentioned...


    man page for host. pretty clearly states it uses dns.

    DESCRIPTION
    host is a simple utility for performing DNS lookups. It is normally
    used to convert names to IP addresses and vice versa. When no argu-
    ments or options are given, host prints a short summary of its command
    line arguments and options.

    name is the domain name that is to be looked up. It can also be a dot-
    ted-decimal IPv4 address or a colon-delimited IPv6 address, in which
    case host will by default perform a reverse lookup for that address.
    server is an optional argument which is either the name or IP address
    of the name server that host should query instead of the server or
    servers listed in /etc/resolv.conf.

    --

    phil


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.0 (MingW32)

    iD8DBQFDScG/Gbd/rBLcaFwRAk8DAKCEC+N2VATLysDsBGoE9DYB+z/v3QCgyPfN
    Yk1OQh+KwKPHPdrmWXN2y88=
    =aLVo
    -----END PGP SIGNATURE-----


  5. Re: Strange problem with local name resolution

    Am Montag, 10. Oktober 2005 03:19 schrieb Phil Dyer:
    > man page for host. pretty clearly states it uses dns.
    >
    > DESCRIPTION
    > host is a simple utility for performing DNS lookups. It is


    Okay, it says: "DNS". But one can also read "DNS" in the sense of
    "getting an IP from a host name" - however this would be done.

    I think this happened because of some little "panic" when I faced the
    problem... ;-)

    Thanks again for your help.

    Regards,
    Andreas

    --
    procommerz - Internet fuer Unternehmen
    www.procommerz.de | 033925-90710

    Öffentlicher GPG-Schlüssel unter:
    http://www.procommerz.de/standort/avent_pub_key.gpg

  6. Re: Strange problem with local name resolution

    Hi,

    You can use "getent hosts ". This will use the c-library's
    lookup mechanisms, as configured in /etc/nsswitch.conf.

    Regards,

    uLI


    --
    To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

+ Reply to Thread