Hi,
I have a SunOS TCP/IP client program worked fine for a long time
until yesterday.
Now, my TCP/IP server program is located on different
DNS server.
The gethostbyaddr ( ) is now returned NULL instead.
struct hostent *hp=gethostbyaddr (addr, len, type);
The nslookup of the server IP failed even thought I
added a correct entry to /etc/hosts file. I believed
this is the behavior of the SunOS nslookup not looking
into the /etc/hosts file.
But, "getent hosts serverName" worked fine.
Anyway, try to make my long story short.
I would like to fix the problem but I am not
how to make get the gethostbyaddr( ) work again
(if possible).
My second option is to change gethostbyaddr ( )
to something similar to "getent" but no ideas
about how to do so.
Any comments/suggestions are appreciated.
Thanks,
Kevin
|
|
0
|
|
|
|
Reply
|
kcw3388 (4)
|
7/27/2005 2:53:20 AM |
|
kcw3388@hotmail.com wrote:
> Hi,
>
> I have a SunOS TCP/IP client program worked fine for a long time
> until yesterday.
>
> Now, my TCP/IP server program is located on different
> DNS server.
>
> The gethostbyaddr ( ) is now returned NULL instead.
>
> struct hostent *hp=gethostbyaddr (addr, len, type);
>
> The nslookup of the server IP failed even thought I
> added a correct entry to /etc/hosts file. I believed
> this is the behavior of the SunOS nslookup not looking
> into the /etc/hosts file.
>
> But, "getent hosts serverName" worked fine.
>
> Anyway, try to make my long story short.
>
> I would like to fix the problem but I am not
> how to make get the gethostbyaddr( ) work again
> (if possible).
>
> My second option is to change gethostbyaddr ( )
> to something similar to "getent" but no ideas
> about how to do so.
>
> Any comments/suggestions are appreciated.
>
> Thanks,
>
> Kevin
>
On SunOS, the file /etc/nsswitch.conf determines what resources
will be used (and in what order) for name and address lookup.
Assuming that this file first points to dns, then the second
problem may be that your DNS administrator has not added the
address-to-name record for the host that you a referencing.
--
Fletcher Glenn
|
|
0
|
|
|
|
Reply
|
Fletcher
|
7/27/2005 3:43:03 PM
|
|