Forum Moderators: open

Message Too Old, No Replies

IP lookup by domain?

How can I find the IP of a domain name that I have?

         

spayeur

8:58 pm on Apr 16, 2003 (gmt 0)

10+ Year Member



Ok, I'm in the ASP script of a page, and I need to find the IP of a domain name that I have. How do I go about retrieving it?

An easier, overall, view is that I'm trying to find out if the domain name is pointing to the same box that is serving the page. Neither the domain name, nor the IP is going to stay constant enough to hard-code them.

Chicago

9:12 pm on Apr 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[arin.net...]

<edit> so sorry, spayeur, for some unknown reason, i thought that I understood you to be looking for an IP look up. Geez, that was silly.

WebJoe

9:47 pm on Apr 16, 2003 (gmt 0)

10+ Year Member



Get the domain name of the current document with:

Request.ServerVariables("SERVER_NAME")

or the IP-adress with:

Request.ServerVariables("LOCAL_ADDR")

for starters...and get the IP of the domain the page is supposed to be on with a whois (Chicagos URL).

I don't know what you want to do with it, because the client won't see your code so it won't help you fighting other that copy your stuff...

spayeur

3:14 pm on Apr 17, 2003 (gmt 0)

10+ Year Member



The situation is one where the page that is hit makes a sub-request for content to another HTTP server via either an XMLHTTP object or another, custom object. Both of these fail when the server being hit is the same as the one serving the ASP page.
Therefore, I have to check to make sure that that is not the case by comparing IPs of both requester and server.

spayeur

5:42 pm on Apr 17, 2003 (gmt 0)

10+ Year Member



Are you sure that ASP has a whois function built-in? That is exactly what I need, though.

"...for starters...and get the IP of the domain the page is supposed to be on with a whois (Chicagos URL)."

spayeur

5:54 pm on Apr 17, 2003 (gmt 0)

10+ Year Member



It gets worse...I have to resolve a domain name within an intranet with its own domain name server, so the official naming servers are not going to know anything about it...("mybox.mydomain.domain.com").

WebJoe

9:58 pm on Apr 21, 2003 (gmt 0)

10+ Year Member




Are you sure that ASP has a whois function built-in? That is exactly what I need, though.

Not quite, but if you sticky me I can point you to several URLs with ASP-based whois functions...some of them you can even give your own DNS-server