Question

DNS Lookup with IP address

Asked by: MasseyM

I 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.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
1998-08-07 at 12:48:02ID10070494
Tags

dns

,

lookup

Topic

Web Authoring

Participating Experts
2
Points
50
Comments
22

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

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.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

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.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

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.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. DNS and IP addresses
    Not an Apache question really, but I hope that people with this expertise could answer the question. Is it possible to get a definitive list of all domain names that use any given IP address? I have an IP address and have done a reverse DNS lookup to get a domain name for it...
  2. Source for a DNS lookup dll
    Hi, I am not allowed to install dlls on the webserver without providing full source code for the dll. I have seen many free dlls for resolving IP addresses to domain names, does anyone have the source code for one of these dlls or know the VB code required to compile one? ...
  3. IP address lookup
    I am doing hit analysis on my website. I know the ip addresses that visited my site. I want to find out more information about an ip address (where it came from, country,etc). Is there a tool out there that does more than DNSLookup? How do I get more information based on ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

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.

Join the Community

Answers

 

by: sybePosted on 1998-08-07 at 17:29:02ID: 1858881

Install perlscript for ASP and then the code is:

<script language=PerlScript RUNAT=Server>
sub GetDomainName
{
      $RemoteHost = gethostbyaddr(inet_aton($ENV{REMOTE_ADDR}),AF_INET);
      return $RemoteHost;
}
</script>
<%
DomainName = GetDomainName()
%>



 

by: MasseyMPosted on 1998-08-07 at 17:54:07ID: 1858882

I dont have access to install Perscript.. Any way via ASP?

 

by: sybePosted on 1998-08-07 at 23:53:57ID: 1858883

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.

 

by: sybePosted on 1998-08-08 at 08:29:36ID: 1858884

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($ENV{REMOTE_ADDR}),AF_INET);
      return $RemoteHost;
}
</script>

<%
DomainName = GetDomainName()
Response.write DomainName
%>


 

by: MasseyMPosted on 1998-08-09 at 07:05:47ID: 1858885

ok, Still no one understands... I DON NOT have Perscript on my server... I will not have it either.  So, there is no way to do it other than with perl?

 

by: MasseyMPosted on 1998-08-09 at 07:06:09ID: 1858886

ok, Still no one understands... I DON NOT have Perscript on my server... I will not have it either.  So, there is no way to do it other than with perl?

 

by: mitekPosted on 1998-08-09 at 13:15:20ID: 1858887

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.

 

by: sybePosted on 1998-08-09 at 14:02:33ID: 1858888

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.

 

by: MasseyMPosted on 1998-08-09 at 18:29:38ID: 1858889

sybe, why do I not stimulate you? :)  I am not here to stimulate, I just need some answer ...

 

by: sybePosted on 1998-08-09 at 22:10:44ID: 1858890

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 ?

 

by: MasseyMPosted on 1998-08-10 at 05:56:43ID: 1858891

OK, sybe, answer the question and you get the points... I don't care anymore.

 

by: mitekPosted on 1998-08-10 at 11:58:39ID: 1858892

I think I have a solution for that problem.
It's an ASP component, that should be used in the following way:

=====================================<BR>
<%
  Set obj = CreateObject("DNS.Lookup")
  hostname = obj.GetNameByIP("204.178.210.195")
  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)

 

by: sybePosted on 1998-08-10 at 12:05:44ID: 1858893

mitek,

you make me curious, did you make that component yourself ? And what did you use to make it.

I have mine finished too, but I don't get it working on PWS/Windows95, although it should. I'll have to try it on a NT machine. I used Java to do it.

 

by: mitekPosted on 1998-08-10 at 12:31:01ID: 1858894

Yep. I wrote it just for fun, in Visual C++ with using ATL library. Not that I really cared about answering that particular question, I just wanted to refresh my knowledge of ATL. And it worked :)
I can send you the source code, if you want. It's not a space shuttle, quite simple.

 

by: MasseyMPosted on 1998-08-10 at 12:36:55ID: 1858895

Sounds good, but I DONT HAVE ACCESS to install the component... Does it have to be installed into ther server, or can I just create an instance from the ASP source?  -- How much more?

- Matt

 

by: mitekPosted on 1998-08-10 at 12:40:18ID: 1858896

Yep. I wrote it just for fun, in Visual C++ with using ATL library. Not that I really cared about answering that particular question, I just wanted to refresh my knowledge of ATL. And it worked :)
I can send you the source code, if you want. It's not a space shuttle, quite simple.

 

by: mitekPosted on 1998-08-10 at 12:49:07ID: 1858897

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.

 

by: mitekPosted on 1998-08-10 at 14:33:27ID: 1858898

(sigh. i guess, he didn't like my last remark. i feel rejected :)

 

by: sybePosted on 1998-08-11 at 03:37:08ID: 1858899

mitek,

yep, i'd like to have the source code for your thing.

If you're interested, I'll send you mine. The only thing is I still haven't got it working: the problem now is that IIS4 treats java differently. *sigh*.


 

by: mitekPosted on 1998-08-11 at 10:55:29ID: 1858900

I'll put it to http://www.sarov.com/downloads/lookup.zip
My email is mitek@i3tele.com -- you may send me Java solution if you want.


 

by: sybePosted on 1998-08-13 at 04:01:48ID: 1858901

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.com/products.htm#aspdns

I have given up temporarily my efforts to make the java-component working on IIS4.

 

by: MasseyMPosted on 1998-08-13 at 07:56:51ID: 1858902

You get the points only because you tried very hard.  You got a B only because you were persistant... Please help me get a working example and I will repost another question worth a lot more...

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...