Re: Any way to bypass nameserver call in IPV6 ???
From: Dale Talcott (aeh_at_quest.cc.purdue.edu)
Date: 08/27/04
- Next message: Gary R. Hook: "Re: How to combine assembly in C source files"
- Previous message: John Leslie: "system V or aix priting subsystem"
- In reply to: T.R.Bennett: "Any way to bypass nameserver call in IPV6 ???"
- Next in thread: T.R.Bennett: "Re: Any way to bypass nameserver call in IPV6 ???"
- Reply: T.R.Bennett: "Re: Any way to bypass nameserver call in IPV6 ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Aug 04 08:49:15 EST
bennett.tony@cnf.com (T.R.Bennett) writes:
>Apache and several other open source projects have converted
>their code from using gethostbyname() to using getaddrinfo().
>They call getaddrinfo with a hints.ai_family = AF_UNSPEC,
>which means "get me both IPV4 as well as IPV6" addresses.
>If I were using gethostbyname(), then I could prevent going
>to the nameserver if I have the host in the /etc/hosts file
>and had /etc/netsvc.conf contain "hosts= local,bind".
>How do I create the same behaviour for IPV6 addresses ?
I cannot answer this part. My guess is that you would need to put IPv6
addresses in /etc/hosts. The docs suggest that is supported, but I
could not find an example.
Now, if you want to get rid of IPv6 queries entirely, use
"hosts=local4,bind4".
>Additionally, I noted that even though I specify a FQDN in
>the getaddrinfo() call, it tries both that name as well as
>a name created by appending my domain name. For example:
> - I specify XXX.YYY.COM
> - getaddrinfo does IPV6 queries for:
> XXX.YYY.COM
> XXX.YYY.COM.YYY.COM
>Is this correct behaviour???
Assuming there is no IPv6 info for XXX.YYY.COM, then it is correct.
I believe you can get rid of the second query by using a resolv.conf
patterned after ours:
search cc.purdue.edu rcs.purdue.edu purdue.edu
options ndots:2
nameserver 127.0.0.1
nameserver 128.210.11.57
That is, replace the domain line with a search line, listing the
various (sub)domains you would like searched for short names (see
next for definition of "short"). In our example, if I specify host
"foo", the resolver library will search for "foo.cc.purdue.edu",
"foo.rcs.purdue.edu", and then "foo.purdue.edu" before asking the world
for "foo".
The next line is the answer to your specific question. "Options ndots:2"
says that any hostname with two or more dots (.) in it is already a FQDN
and should not go through the search list. It should be presented, as is,
for resolution.
This does mean that a request for "foo.com" (one dot) would result in
searches for foo.com.cc.purdue.edu, foo.com.rcs.purdue.edu, and
foo.com.purdue.edu before looking for plain foo.com. However,
www.foo.com triggers only one search.
The remaining "nameserver" lines are normal ones. We run a
caching, forwarding only nameserver on each busy host. Hence the
127.0.0.1 entry. The fall-back is our normal, campus-wide server.
This part is not relevant to your problems, so stay with whatever
you have.
-- Dale Talcott, IT Research Computing Services, Purdue University aeh@quest.cc.purdue.edu http://quest.cc.purdue.edu/~aeh/
- Next message: Gary R. Hook: "Re: How to combine assembly in C source files"
- Previous message: John Leslie: "system V or aix priting subsystem"
- In reply to: T.R.Bennett: "Any way to bypass nameserver call in IPV6 ???"
- Next in thread: T.R.Bennett: "Re: Any way to bypass nameserver call in IPV6 ???"
- Reply: T.R.Bennett: "Re: Any way to bypass nameserver call in IPV6 ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|