Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Slow startx - Why does hostname -f hang?
Date: Sun, 04 Jan 2015 17:21:05
Message-Id: 201501041720.55023.michaelkintzios@gmail.com
In Reply to: [gentoo-user] Slow startx - Why does hostname -f hang? by "Urs Schütz"
1 On Sunday 04 Jan 2015 16:06:50 Urs Schütz wrote:
2 > Hi list
3 >
4 > While hunting down slow startx times (12-16s instead the usual 2-5s) I
5 > found that "hostname -f" tries to resolve the hostname. This is a slow
6 > process (timeout?):
7 >
8 > urs@cadd ~ $ time hostname -v
9 > gethostname()=`cadd'
10 > cadd
11 >
12 > real 0m0.001s
13 > user 0m0.000s
14 > sys 0m0.001s
15 >
16 > urs@cadd ~ $ time hostname -v -f
17 > gethostname()=`cadd'
18 > Resolving `cadd' ...
19 > Result: h_name=`cadd'
20 > Result: h_addr_list=`127.0.0.1'
21 > cadd
22 >
23 > real 0m10.011s
24 > user 0m0.000s
25 > sys 0m0.001s
26 >
27 > urs@cadd ~ $ man hostname
28 > ...snip...
29 > -f, --fqdn, --long
30 > Display the FQDN (Fully Qualified Domain Name). A FQDN
31 > consists
32 > of a short host name and the DNS domain name. Unless
33 > you are
34 > using bind or NIS for host lookups you can change the
35 > FQDN and
36 > the DNS domain name (which is part of the FQDN)
37 > in the
38 > /etc/hosts file.
39 > ...snip...
40 >
41 > My /etc/hosts.conf orders hosts before bind:
42 > urs@cadd ~ $ grep order /etc/host.conf
43 > # recognized are order, trim, mdns, multi, nospoof, spoof, and reorder.
44 > order hosts, bind
45 >
46 > I do not run any NIS or bind services.
47 >
48 > I solved the slow startx by replacing "hostname -f" by "hostname" in the
49 > /usr/bin/startx script, but still feel that I'm missing the real cause
50 > for the slow hostname lookup.
51 >
52 > I do not have a DNS domain name definition in /etc/hosts.
53 > I do run networkmanager.
54 > Any hints where to search?
55 >
56 > What is the recommended way for /etc/hosts? I'm at a simple home
57 > network, behind a NAT cable modem, and do not have a dns domain name.
58 >
59 > Thanks for any hints.
60 > Urs
61
62 In my /etc/hosts I have something like this:
63
64 # IPv4 and IPv6 localhost aliases
65 127.0.0.1 cad.homeLAN localhost cad
66 ::1 cad.homeLAN localhost cad
67
68 See if this solves your problem.
69
70 PS. I remember a thread in this M/L about the correct way to configure a
71 domain name and why how the Gentoo Handbook was wrong. I think there was a
72 bug opened about it, too.
73
74 --
75 Regards,
76 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Slow startx - Why does hostname -f hang? "Urs Schütz" <u.schutz@×××××××.ch>