Gentoo Archives: gentoo-user

From: Richard Fish <bigfish@××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] nscd; what am I doing wrong?
Date: Thu, 22 Dec 2005 04:13:13
Message-Id: 7573e9640512212007w3b1ad8cbna4ef45fc9a6b15da@mail.gmail.com
In Reply to: [gentoo-user] nscd; what am I doing wrong? by Walter Dnes
1 On 12/21/05, Walter Dnes <waltdnes@××××××××.org> wrote:
2 > On Fri, Dec 09, 2005 at 05:08:55PM -0700, Richard Fish wrote
3 >
4 > > nscd does this, and is much simpler. It is already installed as part
5 > > of glibc. Just do rc-update -a nscd default.
6 >
7 > My system is connecting to the net, but nscd doesn't seem to be
8 > caching DNS requests.
9 >
10 > Yes, I did "rc-update add nscd default" and "/etc/init.d/nscd start".
11 > But "ping -c 4 google.com" sends traffic to 192.168.123.254 port 53
12 > each time, even if only 30 seconds apart. This was confirmed by running
13 > "tcpdump -n dst port 53" in another console and watching the output.
14
15 Everything looks ok. Could you try:
16
17 strace -f -o /tmp/strace.out ping -c 4 www.google.com
18
19 Then take a look at /tmp/strace.out. You find some output that looks
20 something like this:
21
22 socket(PF_FILE, SOCK_STREAM, 0) = 4
23 fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR)
24 fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
25 connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0
26 poll([{fd=4, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1
27 writev(4, [{"\2\0\0\0\r\0\0\0\6\0\0\0", 12}, {"hosts\0", 6}], 2) = 18
28 poll([{fd=4, events=POLLIN|POLLERR|POLLHUP,
29 revents=POLLIN|POLLHUP}], 1, 5000) = 1
30 recvmsg(4, {msg_name(0)=NULL, msg_iov(1)=[{"\324_\1A(?", 6}],
31 msg_controllen=0, msg_flags=0}, 0) = 0
32 close(4) = 0
33 socket(PF_FILE, SOCK_STREAM, 0) = 4
34 fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR)
35 fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
36 connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0
37 poll([{fd=4, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1
38 writev(4, [{"\2\0\0\0\4\0\0\0\17\0\0\0", 12}, {"www.google.com\0",
39 15}], 2) = 27
40 poll([{fd=4, events=POLLIN|POLLERR|POLLHUP,
41 revents=POLLIN|POLLHUP}], 1, 5000) = 1
42 read(4, "\2\0\0\0\1\0\0\0\17\0\0\0\0\0\0\0\2\0\0\0\4\0\0\0\1\0\0"...,
43 32) = 32
44 readv(4, [{"www.google.com\0", 15}, {"Bf\7c", 4}], 2) = 19
45 read(4, NULL, 0) = 0
46 close(4) = 0
47
48 -Richard
49
50 --
51 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] nscd; what am I doing wrong? Walter Dnes <waltdnes@××××××××.org>