Re: gethostbyaddr()?




"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)


.



Relevant Pages

  • Re: Just to confirm
    ... > If I query for foobar.zzz I get a not found and can see ... If I take the server down, DNS server, flush ... > the queries against them leave the local network - I can ...
    (microsoft.public.win2000.dns)
  • Re: Just to confirm
    ... >> servers if it can't find the DNS records locally on the ... and we're always able to find internal network ... >> resolve external DNS should you take down the DNS server ... If the internal server answers with a not found the query ...
    (microsoft.public.win2000.dns)
  • Re: Accessing domains in the LAN
    ... Query them. ... Basically you want to test each DNS server and compare responses and try to ... list a DNS server on Your Network with a Private IP not a Public IP ... > Each server has as its primary DNS server, ...
    (microsoft.public.win2000.networking)
  • RE: IPS comparison
    ... >It might if your DNS server doesn't normally do this. ... and anomaly detection. ... analysis tool for network traffic, netflow, firewall logs, host logs, .etc, ... but anomaly detection is just that -- anomalies. ...
    (Focus-IDS)
  • RE: DC Issues
    ... DCs are imputable to DNS server problems. ... For your replication, you should be aware that you will be needing two ... maintain the DCs connected in this network updated. ... Server is not responding or is not considered suitable. ...
    (microsoft.public.windows.server.active_directory)