Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: PATCH: test for network libraries (for test only)/problems with name resolution

> }  - I'm trapped on my own system. The problem is, now, when
> } gethostbyname2 is correctly found, name resolution goes via resolver
> } library. But this is using /etc/hosts only as fallback "if nameserver
> } is not running" (at least in original bind implemetation as found
> } here). Due to our infrastructure, it is unacceptable to me.
> I'm not sure I understand ... do you mean that your nameserver *is*
> running, but is not able to properly resolve all the names you need?

The gethostbyname() from -lnsl on SVR4-derived systems supports service switch
via /etc/netconfig file; here you can define the order of name resolution much
like in Solaris /etc/nsswitch.conf. I normally define it to use both DNS and

The gethostbyname2() from -lresolv does not use service switch and behaves as
described above. It means, that if host is not defined in DNS but in
/etc/hosts, it is not found (assuming, that DNS is properly setup and

In our case, not everything is defined in DNS, hence the problem.

Yes, it is broken system, but there is no (real) chance to ever get it fixed,
now, that development is about to officially stop. So, I have to devise some


Messages sorted by: Reverse Date, Date, Thread, Author