[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: LDAP and DNS



Tony Earnshaw wrote:
tir, 2003-02-18 kl. 10:13 skrev bondpaper:


I'm wondering if anyone can explain what's happening when I run an strace on the following command:

ldapadd -W -D "cn=Manager, dc=stiller, dc=xyz, dc=com" < testldif.ldif,

and I see 3-4 attempts at polling 'localhost.xyz.com' (which adds a substantial delay), and which eventually converts to simply 'localhost'.

My /etc/hosts file has:
127.0.0.1 still.xyz.com localhost


Very probably doing a 'gethostbyname()' and can't find
localhost.xyz.com, which is probably what 'uname -n' returns.

When it can't find that, it goes to /etc/hosts.

You mentioned a whole lot of files, you forgot /etc/nsswitch.conf (if
you have it). I bet it contains a line: "hosts: dns files"

Why not change /etc/hosts to read:
"127.0.0.1 localhost.xyz.com localhost"

Or change your host's name to "still.xyz.com" (if you have Linux, do a
'grep -r still' in /etc/sysconfig, if you have something else you could
be better off just changing /etc/hosts).

Best,

Tony

Tony,

Thanks for your assistance. Maybe some additional info would help. My host name is defined in /etc/sysconfig/network as stiller.xyz.com. And, as you might expect, this host name is returned by uname -n. If I change my /etc/hosts file to:

127.0.0.1 localhost.xyz.com localhost

instead of

127.0.0.1 stiller.zyz.com localhost stiller

I can't ping stiller, or stiller.xyz.com

For the line that you mentioned, the /etc/nsswitch.conf file contains:

hosts: files nisplus dns


FWIW, I'm using the sasl/openldap files that came with redhat 7.3.

Regards,

Tom