Sponsored Content
Full Discussion: gethostbyname failed
Special Forums Windows & DOS: Issues & Discussions gethostbyname failed Post 302369963 by Saurabh78 on Tuesday 10th of November 2009 04:30:35 AM
Old 11-10-2009
gethostbyname failed

gethostbyname is failing and returning NULL on Windows 7. Should i use inet_addr or there is other way to get it
 

10 More Discussions You Might Find Interesting

1. Programming

g++ is OK while gcc is failed

#include <iostream> using namespace std; int main(void) { cout << "hello" << endl; return 0; } I tried this: 1) g++ test.cpp -o test // It's OK 2) gcc test.cpp -o test // Failed /tmp/ccriZviL.o(.text+0x14): In function `main': : undefined reference to... (3 Replies)
Discussion started by: princelinux
3 Replies

2. Solaris

mirror failed

i am working in sun solaris unix platform with storage device T3+ i got an error message mirror failed i have telneted to the storage and gave the command format it gives disk not available , i have shifted my storage from node A to node B then i gave the same command format by telneting to... (0 Replies)
Discussion started by: sasiprabu
0 Replies

3. Programming

regarding gethostbyname()

iam using gethostbyname for verifing whether net is active or not it's work fine but how it's work i mean whether it is using ping or sending socket, who it determining the internet . thank u in advance sree (2 Replies)
Discussion started by: phani_sree
2 Replies

4. AIX

SFTP Failed---Request for subsystem 'sftp' failed on channel 0

Hi, While I am trying SFTP my machine to another unix machine , it was working fine till 10 min back. But now i am getting the below error "Request for subsystem 'sftp' failed on channel 0" Could you please someone help me to solve or analyise the root cause... Cheers:b:, Mahiban (0 Replies)
Discussion started by: mahiban
0 Replies

5. UNIX for Dummies Questions & Answers

Ok. I've have looked and failed.

What I want seems to me should be simple but so am I so.... I have a Unix server that is running a program we will say logged in as UserA. The program is outputting a bunch of stuff to the terminal. I would like to log in from my machine to the server as Either UserA, UserB or if needed... (2 Replies)
Discussion started by: Dishevel
2 Replies

6. OS X (Apple)

Failed Drive

I am trying to recover data off a drive that failed in my iMac. Apple returned the drive to me and I purchased a hard drive enclosure. I have been doing research on prices for data recovery services, way too expensive. I seen some links using Unix DD commands in the terminal none of which worked.... (6 Replies)
Discussion started by: KJ1906
6 Replies

7. IP Networking

The system function gethostbyname() failed to find the client's host name

As we are facing issue with this server connection. The error is: The system function gethostbyname() failed to find the client's host name. how can i check if the server "server1" is able to resolve the client hostname (hosts / dns)? i can ping the client from server. any... (1 Reply)
Discussion started by: jinslick25
1 Replies

8. Solaris

Cygwin X Server error: xdmcp fatal error session failed session 23 failed for display

Hi, i got the following error when i tried to access the cygwin x server from a windows XP PC. "xdmcp fatal error session failed session 23 failed for display" Alternatively, when i tried to access the same Cygwin X Server from another windows XP PC which is on a different LAN... (3 Replies)
Discussion started by: HarishKumarM
3 Replies

9. UNIX for Dummies Questions & Answers

FTP failed

Hi All, We are using the following step to place a file in server using FTP STEP_EXECUTE STEP090 /usr/pjc/bin/FTP -i DATASET FTPIN $sic/ctl/ftpsic.ctl DISP=OLD,KEEP,KEEP STEP_END If we run this step we are getting the error. ftp> open arg.mnd.appsc.com Connected to arg.mnd.appsc.com.... (4 Replies)
Discussion started by: ajaykumarkona
4 Replies

10. Red Hat

Failed to su to user

I am unable to su to functional user, though changed the soft-hard limit for open files in limits.conf. The following command did not help.ulimit -n <value>While su to user, the error I am getting is -su: cannot set user id: Resource temporarily unavailableWhether I need to restart the application... (1 Reply)
Discussion started by: atanubanerji
1 Replies
GETHOSTBYADDR(P)					     POSIX Programmer's Manual						  GETHOSTBYADDR(P)

NAME
gethostbyaddr, gethostbyname - network host database functions SYNOPSIS
#include <netdb.h> struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type); struct hostent *gethostbyname(const char *name); DESCRIPTION
These functions shall retrieve information about hosts. This information is considered to be stored in a database that can be accessed sequentially or randomly. Implementation of this database is unspecified. Note: In many cases it is implemented by the Domain Name System, as documented in RFC 1034, RFC 1035, and RFC 1886. Entries shall be returned in hostent structures. The gethostbyaddr() function shall return an entry containing addresses of address family type for the host with address addr. The len argument contains the length of the address pointed to by addr. The gethostbyaddr() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe. The gethostbyname() function shall return an entry containing addresses of address family AF_INET for the host with name name. The gethost- byname() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe. The addr argument of gethostbyaddr() shall be an in_addr structure when type is AF_INET. It contains a binary format (that is, not null- terminated) address in network byte order. The gethostbyaddr() function is not guaranteed to return addresses of address families other than AF_INET, even when such addresses exist in the database. If gethostbyaddr() returns successfully, then the h_addrtype field in the result shall be the same as the type argument that was passed to the function, and the h_addr_list field shall list a single address that is a copy of the addr argument that was passed to the function. The name argument of gethostbyname() shall be a node name; the behavior of gethostbyname() when passed a numeric address string is unspeci- fied. For IPv4, a numeric address string shall be in the dotted-decimal notation described in inet_addr() . If name is not a numeric address string and is an alias for a valid host name, then gethostbyname() shall return information about the host name to which the alias refers, and name shall be included in the list of aliases returned. RETURN VALUE
Upon successful completion, these functions shall return a pointer to a hostent structure if the requested entry was found, and a null pointer if the end of the database was reached or the requested entry was not found. Upon unsuccessful completion, gethostbyaddr() and gethostbyname() shall set h_errno to indicate the error. ERRORS
These functions shall fail in the following cases. The gethostbyaddr() and gethostbyname() functions shall set h_errno to the value shown in the list below. Any changes to errno are unspecified. HOST_NOT_FOUND No such host is known. NO_DATA The server recognized the request and the name, but no address is available. Another type of request to the name server for the domain might return an answer. NO_RECOVERY An unexpected server failure occurred which cannot be recovered. TRY_AGAIN A temporary and possibly transient error occurred, such as a failure of a server to respond. The following sections are informative. EXAMPLES
None. APPLICATION USAGE
The gethostbyaddr() and gethostbyname() functions may return pointers to static data, which may be overwritten by subsequent calls to any of these functions. The getaddrinfo() and getnameinfo() functions are preferred over the gethostbyaddr() and gethostbyname() functions. RATIONALE
None. FUTURE DIRECTIONS
The gethostbyaddr() and gethostbyname() functions may be withdrawn in a future version. SEE ALSO
endhostent() , endservent() , gai_strerror() , getaddrinfo() , h_errno() , inet_addr() , the Base Definitions volume of IEEE Std 1003.1-2001, <netdb.h> COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 GETHOSTBYADDR(P)

Featured Tech Videos

All times are GMT -4. The time now is 01:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy