473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

converting IP addresses to domains

ive got a piece of software (perl) that i use to track visitors on my site.
this software displays both ip addresses and domains of visitors

e.g.

A visitor from 81-178-202-110.dsl.pipex.com (81.178.202.110)
arrived without a referring URL,
and visited www.newmediadesigns.co.uk/index.shtml
at 03:01:28 PM on Friday, March 26, 2004.
This visitor used Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1).

what code do i need to display this domain information in asp?

thanks

mark
Jul 19 '05 #1
3 1188
<%
strString = request.servervariables("REMOTE_HOST")
response.write strString
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
mark | r <ma**@nmd.freeuk.com> wrote in message
news:40***********************@news.dial.pipex.com ...
ive got a piece of software (perl) that i use to track visitors on my site. this software displays both ip addresses and domains of visitors

e.g.

A visitor from 81-178-202-110.dsl.pipex.com (81.178.202.110)
arrived without a referring URL,
and visited www.newmediadesigns.co.uk/index.shtml
at 03:01:28 PM on Friday, March 26, 2004.
This visitor used Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1).

what code do i need to display this domain information in asp?

thanks

mark

Jul 19 '05 #2
You need IIS to handle DNS lookups. This is *quite* expensive in terms of
performance, so I would only consider this functionality if you really,
really, really, really, really need it. Start here:
http://www.aspfaq.com/2044

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"mark | r" <ma**@nmd.freeuk.com> wrote in message
news:40***********************@news.dial.pipex.com ...
ive got a piece of software (perl) that i use to track visitors on my
site.
this software displays both ip addresses and domains of visitors

e.g.

A visitor from 81-178-202-110.dsl.pipex.com (81.178.202.110)
arrived without a referring URL,
and visited www.newmediadesigns.co.uk/index.shtml
at 03:01:28 PM on Friday, March 26, 2004.
This visitor used Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1).

what code do i need to display this domain information in asp?

thanks

mark

Jul 19 '05 #3
This method's a bit flakey, but it'll work from time to time.

<%
Dim sIP
Dim oShell, oExec, sCommand, sOutput
sIP = Request.ServerVariables("REMOTE_ADDR")
sCommand = "%comspec% /c @echo off & for /f ""tokens=2"" %q in ('ping -n
1 -a " & sIP & "^|find /i ""pinging""') do echo %q"
Set oShell = Server.CreateObject("WScript.Shell")
Set oExec = oShell.Exec(sCommand)
sOutput = sOutput & oExec.StdOut.ReadAll
Set oExec = Nothing
Set oShell = NOthing
Response.WRite sOutput
%>

Watch for line wrap. This is all one line:

sCommand = "%com....... echo %q"

You could also apply the same logic and use nslookup instead.

Ray at work
"mark | r" <ma**@nmd.freeuk.com> wrote in message
news:40***********************@news.dial.pipex.com ...
ive got a piece of software (perl) that i use to track visitors on my site. this software displays both ip addresses and domains of visitors

e.g.

A visitor from 81-178-202-110.dsl.pipex.com (81.178.202.110)
arrived without a referring URL,
and visited www.newmediadesigns.co.uk/index.shtml
at 03:01:28 PM on Friday, March 26, 2004.
This visitor used Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1).

what code do i need to display this domain information in asp?

thanks

mark

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Peter Murray | last post by:
Hi! I hope someone can assist me, I have been using Python for a year or two, but I am not a programmer and only use it occasionally for small issues or just for fun. So I perhaps do not have the...
10
by: Chris Sharman | last post by:
I'm doing a rough validation of an email address client-side (using js), but it's not enough - our customer service people are apparently incapable of typing in an email address without error - we...
24
by: Arno R | last post by:
Hi all, I have a client with several shoe-shops. Customers can leave their email-address if they want to be notified when there is a sale. Input is validated with instr() I am checking for @...
6
by: Ludvig | last post by:
I have various domains using the same application/assembly They differ in contents and design, based on a "site id", and get its information from an SQL server. Now I have to deploy the...
7
by: Doug | last post by:
An ASP.NET session cookie set on "www.mydomain.com" can not be accessed on "search.mydomain.com"; hence, a new session and cookie are being created on every sub-domain. This is occuring because...
3
by: Nathan Sokalski | last post by:
I have an ASP.NET page that sends a Mail.MailMessage to several email addresses (all mine). However, one of the addresses, the one ending in @verizon.net, does not seem to be recieving the message...
6
by: jerrygarciuh | last post by:
Hi folks, HELP!!!! My habitual use of mail() is causing me some grief. I am having slightly different results depending on the server I use but the gist is that mail() is returning 1, and I...
23
by: codefire | last post by:
Hi, I am trying to get a regexp to validate email addresses but can't get it quite right. The problem is I can't quite find the regexp to deal with ignoring the case james..kirk@fred.com, which...
2
by: xx75vulcan | last post by:
Howdy, I have successfully setup my php.ini file on a web server to communicate with my Microsoft Exchange Mail server, and can test the ability to send mail using the mail() function to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.