Re: DNS lookup delays

From: Tim (admin_at_sheerhell.lan)
Date: 10/05/03


Date: Mon, 06 Oct 2003 00:51:55 +0930

Tim <admin@sheerhell.lan> wrote:
 
>> I've just looked back through the thread, and noticed something that I
>> missed (your hosts file). I'm not sure whether I have all posts to this
>> thread, but it looks a bit odd.

Michael Grant <usenet-poster@Michael-Grant.me.uk> wrote:
  
> I'd shuffled the lines about a bit to get them to look more like the
> machines at work. I've tried reordering them so the first line is now:
>
> 127.0.0.1 localhost.localdomain localhost luminiferous luminiferous.aethernet
>
> and the only difference it made was to turn the default name (used in
> my prompt into "localhost%", so I turned it back[1].

You want to set your hostname, so the machine isn't trying to work it
out for itself. Read the hostname manual for full information, but if
you're using the GUI tool "neat" ("network" inside the Gnome "system
settings" menu), you can set it from there.

Typing hostname by itself, into the Command Line Interface, will tell
you what the current hostname is. Typing hostname followed by the
hostname that you want, will set it.

i.e. hostname luminiferous

(Glowing rust?) ;-)

That'll solve two problems; the one we've been discussing all along, and
your prompt one.

 
> This is a single machine connected via Ethernet to my housemate's
> broadband router[0], which is connected to the Internet via ADSL. The
> machine has a dynamic IP address allocated by the ISP; I call it
> luminiferous.aethernet as you have seen[1][2] but, obviously, don't
> expect anything outside this machine to recognise that name.

It might be a peculiar enough attempt at a FQDN that other things don't
like it either (e.g you own print server). For my own system, I just
kept on using localdomain for everything:

127.0.0.1 localhost.localdomain localhost
192.168.0.1 one.localdomain one
192.168.0.2 two.localdomain two mail.localdomain www.localdomain

and so on...

Do you mean that your machine is being given an IP by the ISP, or their
system that you connect to. If each machine is being given a public IP,
you may need to let it assign that interface a public hostname, too.

> I just had a hunch and tried firing up my desktop (rarely used, as
> it's old and slow and doesn't have an Ethernet card), and it can
> access the address localhost immediately. So I tried pulling out my
> Ethernet PC card on luminiferous, and lo and behold it too could
> access localhost immediately. I plugged the card back in, and the
> ten-second delay reappears. Does this give you (or anyone else) any
> leads?

That sounds awfully like it's not using its own hosts file to work out
the IP for localhost.

> The Ethernet card of my housemate's I'm using[3] says "Accton" and
> "146133-022" on it. dmesg reports:
> eth0: NE2000 Compatible: io 0x300, irq 3, hw_addr 00:00:E8:3A:C2:B7
> /var/log/messages further says:
> Oct 4 20:18:21 luminiferous cardmgr[769]: socket 0: Melco LPC2-T Ethernet
>
> Another alternative has just struck me: Do you think the firewall on
> the broadband router might be the cause of my problems?

It's possible.

> [0] Which may not be a _router_ per se but just a little hub.
>
> [2] And because I couldn't get my printer to work without the machine
> having a FQDN, for some reason.

There's a number of services and applications which require a hostname
with a dot in it. That's one reason why we have localhost.localdomain
and localhost. They will try and get the hostname for the local
machine, and then try to use the hostname. Obviously, if it can't
figure out the name, whatever else it's going to do is stymied.

>> Unless your machines hostname is a registered domain name, then your
>> ISPs domain name servers aren't going to help you (they're not going to
>> help you with localhost addresses, either). For local names, you need
>> to resolve them locally (via the hosts file, or your own DNS server).
>> For most things, the hosts file is fine, but some things (e.g. the Squid
>> proxy server on my system) need a DNS server.
 
> I don't understand this. Name lookup (other than in /etc/hosts) _is_
> done by my ISP; as I just proved to myself by temporarily breaking the
> IP addresses /etc/resolv.conf. What do you mean?

Well an ISP's DNS server is only going to have registered domain names
in their database. They're not going to have made up ones, nor will
they return results for "localhost" queries. It's not something in
their purview.

For other things (non-registered names, and local machine names), you
need to do this yourself. That's usually done by your hosts file,
though some things won't look at it (e.g. Squid, on my machines), or by
running your own DNS server.
  

>> More information is needed about your system. Another thing that's not
>> too clear, is whether you're trying to use a mail server running on your
>> own system, or your ISP's mail server.
 
> For outgoing email, the ISP's mail server; for incoming mail sendmail
> running locally.

So the mailserver that you're having trouble connecting to is your ISPs?
That points a finger at a slow DNS server, or a firewall blocking auth
or ident connection attempts, and the server is (stupidly) trying to
check who you are that way.

-- 
My "from" address is totally fake.  The reply-to address is real, but 
may be only temporary.  Reply to usenet postings in the same place as 
you read the message you're replying to.


Relevant Pages

  • Re: (was Re: setting FQDN in /etc/hosts)
    ... There should be a space before the word localhost, ... the hostname command will tell you what ... 503 Leafnode must have a unique fully-qualified domain name. ... ## This is the NNTP server leafnode fetches its news from. ...
    (news.software.readers)
  • Re: DBIx::DBH - Perl extension for simplifying database connections
    ... host that it would not connect using the host name and end up using TCP on ... The server name is ... important because I use the localhost name to match up with that, ... matches then don't add in the hostname to the connect string. ...
    (perl.dbi.users)
  • Re: Unable to resolve hostname (winsock problem?)
    ... > The only thing in my hosts file is localhost. ... > <hostname> to force DNS hostname resolution and this morning, ... the problem occurs when I don't try to resolve hostnames for a while. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: DNS lookup delays
    ... >> Some programs will not use the entries in the hosts file, ... own mail server), on the same line. ... itself (i.e. not needing your ISPs name server). ... What's your machine's hostname. ...
    (linux.redhat.install)
  • Trouble with hosts file - am I doing this right?
    ... My hosts file contains only: ... localhost ... Where 64.246.46.90 is a server I never want to connect to ... Ping statistics for 127.0.0.1: ...
    (microsoft.public.windowsxp.help_and_support)