Re: gethostbyaddr()?
- From: "Remy Lebeau" <no.spam@xxxxxxxxxxx>
- Date: Thu, 18 Jun 2009 13:30:53 -0700
"Vincent Fatica" <vince@xxxxxxxxxxxxxxxxx> wrote in message
news:4a358c2b$1@xxxxxxxxxxxxxxxxxxxx
When given my computer's internet IP (CHAR IP[4] = {72,230,122,241};)
both gethostbyaddr() and WSAAsyncGetHostByAddr() give the name
ZZ.twcny.rr.com
That name is a **useless** combination of my computer's "given" name,
"ZZ",
and my "Connection-specific DNS Suffix" (according to IPCONFIG /ALL).
Why is that useless to you? What are you trying to use the resolved name
for exactly?
What are these functions doing
You are asking the OS to query the name of an IP that is attached to your
machine directly. The OS does not have to perform a query to the ISP's DNS
server, as it already knows the machine's local name (assigned in the OS
properties) and the suffix of the network adapter the IP belongs to
(assigned by the ISP's DNS server when leasing a dynamic IP, or can be
assigned statically in the adapter's properties).
is there any way to use them to get
cpe-72-230-122-241.twcny.res.rr.com
Not for IPs on your local network, no. They will do that for external IPs,
though, since they would have to query those network's DNS servers. If you
need that kind of value for local IPs (why would you?), you would have to
manually query a DNS server that is outside your ISP's network, since you
are trying to retreive the kind of path that the outside world uses to reach
your machine through your ISP.
which is what NSLOOKUP gives
Not always.
--
Remy Lebeau (TeamB)
.
- Follow-Ups:
- Re: gethostbyaddr()?
- From: Vincent Fatica
- Re: gethostbyaddr()?
- References:
- gethostbyaddr()?
- From: Vincent Fatica
- gethostbyaddr()?
- Prev by Date: Re: gethostbyaddr()?
- Next by Date: Is there a TCP equivalent to IPX_IMMEDIATESPXACK?
- Previous by thread: Re: gethostbyaddr()?
- Next by thread: Re: gethostbyaddr()?
- Index(es):
Relevant Pages
|