gethostbyaddr/nslookup failed

K

kcw3388

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
 
A

Artie Gold

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.

Since this has nothing to do with standard C, either
or a Solaris newsgroup would be the *right*
place to ask.

HTH
--ag
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top