Gentoo Archives: gentoo-user

From: "Urs Schütz" <u.schutz@×××××××.ch>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Slow startx - Why does hostname -f hang?
Date: Sun, 04 Jan 2015 16:07:01
Message-Id: 54A9651A.3080207@bluewin.ch
1 Hi list
2
3 While hunting down slow startx times (12-16s instead the usual 2-5s) I
4 found that "hostname -f" tries to resolve the hostname. This is a slow
5 process (timeout?):
6
7 urs@cadd ~ $ time hostname -v
8 gethostname()=`cadd'
9 cadd
10
11 real 0m0.001s
12 user 0m0.000s
13 sys 0m0.001s
14
15 urs@cadd ~ $ time hostname -v -f
16 gethostname()=`cadd'
17 Resolving `cadd' ...
18 Result: h_name=`cadd'
19 Result: h_addr_list=`127.0.0.1'
20 cadd
21
22 real 0m10.011s
23 user 0m0.000s
24 sys 0m0.001s
25
26 urs@cadd ~ $ man hostname
27 ...snip...
28 -f, --fqdn, --long
29 Display the FQDN (Fully Qualified Domain Name). A FQDN
30 consists
31 of a short host name and the DNS domain name. Unless
32 you are
33 using bind or NIS for host lookups you can change the
34 FQDN and
35 the DNS domain name (which is part of the FQDN)
36 in the
37 /etc/hosts file.
38 ...snip...
39
40 My /etc/hosts.conf orders hosts before bind:
41 urs@cadd ~ $ grep order /etc/host.conf
42 # recognized are order, trim, mdns, multi, nospoof, spoof, and reorder.
43 order hosts, bind
44
45 I do not run any NIS or bind services.
46
47 I solved the slow startx by replacing "hostname -f" by "hostname" in the
48 /usr/bin/startx script, but still feel that I'm missing the real cause
49 for the slow hostname lookup.
50
51 I do not have a DNS domain name definition in /etc/hosts.
52 I do run networkmanager.
53 Any hints where to search?
54
55 What is the recommended way for /etc/hosts? I'm at a simple home
56 network, behind a NAT cable modem, and do not have a dns domain name.
57
58 Thanks for any hints.
59 Urs

Replies

Subject Author
Re: [gentoo-user] Slow startx - Why does hostname -f hang? Mick <michaelkintzios@×××××.com>
Re: [gentoo-user] Slow startx - Why does hostname -f hang? wabenbau@×××××.com