NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Problem with NetBSd 5.1.2 / gethostbyname / nsswitch.conf or bind resolving chain of multiple cnames



On 9/9/2012 6:47 PM, Christos Zoulas wrote:
> In article 
> <CAHKF-Au2FEVpEtG=fH0-W2KXGeGrSBzQkc4ZmYU=DX87mcFTdg%mail.gmail.com@localhost>,
> matthew sporleder <msporleder%gmail.com@localhost> wrote:
>> On Sun, Sep 9, 2012 at 11:25 AM, matthew sporleder
<msporleder%gmail.com@localhost> wrote:
>>> On Sun, Sep 9, 2012 at 5:43 AM, thilo <thilo%nispuk.com@localhost> wrote:
>>>> Hello everyone,
>>>>
>>>> I have an issue with my name resolving and I am not sure where the
>>>> problem lies:
>>>>
>>>> On my server I can resolve an address with multiple cnames via nslookup
>>>> to my local bind server.
>>>> The clibrary gethostbyname fails the lookup if the cname chain is
>>>> greater than 2.
>>>> I cannot seem to find anywhere a switch/define that would limit the
>>>> number of recursive lookups.
>>>>
>>>> Changing the order in /etc/nsswitch.conf from "files dns" -> "dns
>>>> file" changes the herror output from
>>>> "Unknown server error" -> "Unknown host".
>>>> Interesting enough windows and linux clients in my network do not have
>>>> this problem, but another netbsd box does too.
>>>>
>>>> Does someone know what is wrong in my configuration?
>>>> Thanks for the help
>>>> thilo
>>>>
>>>>
>>>> == log from various tools ==
>>>> -bash-4.2$ nslookup dradio_mp3_dkultur_m.akacast.akamaistream.net
>>>> Server: 127.0.0.1
>>>> Address: 127.0.0.1#53
>>>>
>>>> Non-authoritative answer:
>>>> dradio_mp3_dkultur_m.akacast.akamaistream.net canonical name =
>>>> out.icecast.akadns.net.
>>>> out.icecast.akadns.net canonical name = eu.ic.akadns.net.
>>>> eu.ic.akadns.net canonical name = edge13647.icecast.akadns.net.
>>>> Name: edge13647.icecast.akadns.net
>>>> Address: 195.27.154.158
>>>>
>>>> ====== PING FIRST HOST==================================
>>>> -bash-4.2$ ping -c 1 dradio_mp3_dkultur_m.akacast.akamaistream.net
>>>> ping: Cannot resolve "dradio_mp3_dkultur_m.akacast.akamaistream.net"
>>>> (Unknown host)
>>>> ====== PING SECOND HOST==================================
>>>> -bash-4.2$ ping -c 1 out.icecast.akadns.net
>>>> PING edge14152.icecast.akadns.net (195.10.36.180): 56 data bytes
>>>> 64 bytes from 195.10.36.180: icmp_seq=0 ttl=59 time=63.583 ms
>>>>
>>>> ----edge14152.icecast.akadns.net PING Statistics----
>>>> 1 packets transmitted, 1 packets received, 0.0% packet loss
>>>> round-trip min/avg/max/stddev = 63.583/63.583/63.583/0.000 ms
>>>> =========UNAME=======================================
>>>> -bash-4.2$ uname -a
>>>> NetBSD maggi 5.1.2 NetBSD 5.1.2 (GENERIC) #0: Thu Feb 2 12:12:28 UTC
>>>> 2012
>>>>
>>
builds%b7.netbsd.org@localhost:/home/builds/ab/netbsd-5-1-2-RELEASE/amd64/201202021012Z-obj/home/builds/ab/netbsd-5-1-2-RELEASE/src/sys/arch/amd64/compile/GENERIC
>>>> amd64
>>>>
>>>> ============= NAMED versions =============
>>>> I tried bind 9.7.3 and 9.9.1 :
>>>> -bash-4.2$ /usr/sbin/named -v
>>>> BIND 9.7.3-P3
>>>> -bash-4.2$ /usr/pkg/sbin/named -v
>>>> BIND 9.9.1-P2
>>>> -bash-4.2$
>>>>
>>>> ================================
>>>
>>>
>>> This is true on my box too.
>>>
>>> getent hosts dradio_mp3_dkultur_m.akacast.akamaistream.net
>>
>> This is an issue with netbsd resolving hosts with _ (underscore) in
the name.
>
> Yes, cvs update, build and then "options no-check-names" in resolv.conf.
>
> christos
>
Hmm your checking from today just disables all name checking.
Is that the right way to do it?
I thought the RFC specifies that names beginning with underscores are to
differntiate services from hostnames.
With this this would be wrong wouldn't it?

cheers thilo

---
> __RCSID("$NetBSD: gethnamaddr.c,v 1.79 2012/09/09 16:42:23 christos Exp $");
103a104,109
> #define maybe_ok(res, nm, ok) (((res)->options & RES_NOCHECKNAME) != 0U || \
> (ok)(nm) != 0)
> #define maybe_hnok(res, hn) maybe_ok((res), (hn), res_hnok)
> #define maybe_dnok(res, dn) maybe_ok((res), (dn), res_dnok)
>
>
261c267
<       if ((n < 0) || !(*name_ok)(bp)) {
---
> if ((n < 0) || !maybe_ok(res, bp, name_ok)) {
2


-- 
Dipl. Ing. Thilo Jeremias
Zur Rabenwiese 14
27239 Twistringen
T: +49 15782492240
T: +49 4243941633

begin:vcard
fn:Thilo Jeremias
n:Jeremias;Thilo
email;internet:thilo%nispuk.com@localhost
tel;work:+49 15782492240
tel;home:+49 4243941633
version:2.1
end:vcard



Home | Main Index | Thread Index | Old Index