Re: Any way to bypass nameserver call in IPV6 ???
From: T.R.Bennett (bennett.tony_at_cnf.com)
Date: 08/27/04
- Next message: sumGirl: "should I mirror paging space?"
- Previous message: Kenneth: "AIX CIO with Oracle"
- In reply to: Dale Talcott: "Re: Any way to bypass nameserver call in IPV6 ???"
- Next in thread: Richard D. Latham: "Re: Any way to bypass nameserver call in IPV6 ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Aug 2004 14:09:34 -0700
aeh@quest.cc.purdue.edu (Dale Talcott) wrote in message news:<aeh.1093614555@quest.cc.purdue.edu>...
> 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,
Thanks for your detailed answer.
Unfortunately, on my AIX 5.1 system, it doesn't appear to work.
BTW, we don't have IPV6 addresses yet, but I don't want to put
that requirement in my code.
I tried:
search cnf.com
options ndots:2
nameserver xxx.yyy.zzz.12
nameserver xxx.yyy.zzz.13
Then I tried the getaddrinfo() call specifying a host of
"ljcqs048.cnf.com",
IPV4 versions are satisfied out of the /etc/hosts file, but there are
two querys made to the nameserver:
ljcqs048.cnf.com for a type AAAA
ljcqs048.cnf.com.cnf.com for a type AAAA
So, "ndots:2" doesn't seem to work.
What works "partially", is leaving resolv.conf as it was originally:
domain cnf.com
nameserver xxx.yyy.zzz.12
nameserver xxx.yyy.zzz.13
And changing /etc/netsvc.conf to what you suggested:
hosts = local4 , bind4
I say "partially", because there is no query for
"ljcqs048.cnf.com.cnf.com",
but there IS a nameserver query for a type A record for
"ljcqs048.cnf.com"
...i.e. an IPV4 address...but IPV4 addresses should have been
satisfied out of the /etc/hosts file. ???
Thanks again for your help.
-tony
- Next message: sumGirl: "should I mirror paging space?"
- Previous message: Kenneth: "AIX CIO with Oracle"
- In reply to: Dale Talcott: "Re: Any way to bypass nameserver call in IPV6 ???"
- Next in thread: Richard D. Latham: "Re: Any way to bypass nameserver call in IPV6 ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|