I dont have access to install Perscript.. Any way via ASP?
Main Topics
Browse All TopicsI have an ip address ###.###.###.### and i want the "friendlier" name for it www.friendlyname.com... How can I do that in ASP? Source Code please... Please don't post an answer that says "YOu can't"... Thanks.
- Matt
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Perlscript can be used in ASP, just as you can use VBScript or Javascript.
So perlscript IS ASP :)
Probably yo mean if there is a way in VBScript. The thing is that you have to do some reverse DNS-lookup. You could try and write the VBScript for that your self, or use those which are available.
- Available is the perl routine (if you have perl & perlscript installed
- available is NS-lookup (if you have that installed on your machine). It runs from the command prompt. You could try to use that by calling it from ASP and make it write to a small file on HD, read that file and get the domainname from it. It is not a very elegant way, but it works (i have used it, but not with ASP)
If you would like to have source code for that, I don't have it, you would have to give more then 50 points to make me work on that. You can probably figure the code out yourself.
There was something missing in the code using perlscript, so I'll post the working code here, for those who are interested.
Another solution on which I am working is to make a COM object using java, and call that from the ASP. Using java it should be too hard to get the domain name based on the IP address, since java (just like perl) is web-oriented and has inbuilt function for such things.
When I have that working i'll post the java-code and the procedure of registering it at as a COM-object so it can be accesed through ASP.
Anyway, here's the working code with perlscript (it needed a "use Socket" statement).
<script language=PerlScript RUNAT=Server>
use Socket;
sub GetDomainName
{
$RemoteHost = gethostbyaddr(inet_aton($E
return $RemoteHost;
}
</script>
<%
DomainName = GetDomainName()
Response.write DomainName
%>
Well, actually, you could write an ASP component using C++ and ATL. But again, you won't be able to install it since you don't have access to your server configuration. And VBScript will not allow you to do many things ...
Usually, when one has to do something fancy in VBScript, it's time to write an ATL ActiveX (server-side) component. And PerlScript is just a simplest way around that problem, because it's already sort of an ActiveX component.
We once wrote such a component, one that did something that VBScript could never do: connect to a OWS 2.0 server (Oracle) and do transactions, like login, charge points, etc. We knew exactly that VBScript could never do that, so there was no questions like "how to do something like that in ASP ?"
There some limitations to VBScript that can't be resolved w/o resorting to a different level of technology. This seems to be one of them.
I suggest you accept sybe's answer -- it's very logical and by far the most simple.
There should be another way: java, as I have pointed out.
The thing is that ASP and VBScript do not offer the functionality that you need for that, so you have to import that functionality from another programming language: perl or java then seem to be the best options, since those are very much internet oriented languages.
I have written a component in Java that does the trick. The only thing is that it bumps on a bug in java 1.02 (so in fact does not do the trick). I can't get it working on a win95 machine, but i'll hope i will get it working on NT4 (after the weekend, you'll have to wait).
By the way, MassyeM, the problem interests me, but your reactions are not very stimulating.
MasseyM,
I gave you one working answer completely worked out and two suggestions of how to find another solution.
You have not reacted at all on the suggestions that I made. I will repeat them here:
1. Use NSlookup, this is an NT program that runs from the command prompt and does a reverse DNS lookup. Try to make it run with ASP and read the output. You might also try it with Ping, which also returns the domain-name.
2. Use java to make a class file that does the trick. Then register it as a component, so it can be called through ASP.
You could indicate if these suggestions are what you might be looking for, or that you can tell in advance that it is out of the question.
Is NSLookup installed on the machine ?
Can you compile javacode ? you can download compilers for free (or is that too much trouble).
Can you register a component ? or don't you have access for that ?
I think I have a solution for that problem.
It's an ASP component, that should be used in the following way:
==========================
<%
Set obj = CreateObject("DNS.Lookup")
hostname = obj.GetNameByIP("204.178.2
error_text = obj.GetErrorText
Set obj = Nothing
%>
<%=hostname%>
<BR>
Error: <%=error_text%>
<BR>
==========================
<BR>
If you're interested, tell me what you think about it.
You don't have to accept my answer, until you see the component. Besides, this answere will definitely cost more than 50 points (maybe, not much more, though)
short answer:
if you can run
regsrv32 component.dll (in other words, to register a component) on the server, you can install it.
If you can't, sorry -- you can't.
(don't worry, i have a feeling it won't go on much longer)
whatever happens -- i'm making my component a shareware thingy.
if someone needs it in the future, it'll be there
the main point, it IS possible. for those, who have access to the server.
I'll put it to http://www.sarov.com/downl
My email is mitek@i3tele.com -- you may send me Java solution if you want.
MasseyM,
Ok, I'll answer the question. With the remark that a mitek in not the only one who programmed a working component for DNSLookup.
See:
http://www.serverobjects.c
I have given up temporarily my efforts to make the java-component working on IIS4.
Business Accounts
Answer for Membership
by: sybePosted on 1998-08-07 at 17:29:02ID: 1858881
Install perlscript for ASP and then the code is:
NV{REMOTE_ ADDR}),AF_ INET);
<script language=PerlScript RUNAT=Server>
sub GetDomainName
{
$RemoteHost = gethostbyaddr(inet_aton($E
return $RemoteHost;
}
</script>
<%
DomainName = GetDomainName()
%>