Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

Please help: How to get the alias hostname ??

Thread view: 
tongyizhou@gmail.com - 01 Apr 2006 16:10 GMT
I don't know how to get all the alias hostname of an IP address. I have
looked through the net but got no answer.
Could somebody help me?? It's very urgent and important to me!!

Thanks!
James McGill - 01 Apr 2006 16:31 GMT
> I don't know how to get all the alias hostname of an IP address. I have
> looked through the net but got no answer.
> Could somebody help me?? It's very urgent and important to me!!

You can never know all possible aliases.  How would your routine ever
know I call 127.0.0.1 "lo" "localhost" and "zero"?  

Ok, but seriously, you can do a reverse DNS lookup and then do a forward
lookup and collect CNAME records.

Why do you need to do this?  
tongyizhou@gmail.com - 01 Apr 2006 16:56 GMT
Well, it might sounds funny.
I am just a Chinese student, and that's just a  function I must
implement in my homework.  Due to the requirements I must  print out
all the aliases hostname and the IP addresses of the destnation URL. It
just a funny meaningless requirement right ?^_^? I just have no choice.

I will be very appreciate if U can help me out T_T
James McGill - 01 Apr 2006 18:03 GMT
> Due to the requirements I must  print out
> all the aliases hostname and the IP addresses of the destnation URL.

Well, getting the IP address is simple enough.  For the aliases I would
do a dns lookup for CNAME records, and then pick the CNAMEs that point
to the IP address that the original hostname resolves to.  But I might
be misunderstanding the project.
Ronny Schuetz - 01 Apr 2006 18:25 GMT
Hi,

> Ok, but seriously, you can do a reverse DNS lookup and then do a forward
> lookup and collect CNAME records.

Might be a dumb question, but how exactly are you going to collect the
CNAME records? I thought it is not possible to look them up based on the
primary name of the machine or its IP address only.

Ronny
James McGill - 01 Apr 2006 21:01 GMT
> Might be a dumb question, but how exactly are you going to collect the
> CNAME records? I thought it is not possible to look them up based on
> the
> primary name of the machine or its IP address only.

It's not necessarily possible! There are many cases where it's not
possible at all.  But in the nice cases, especially those where you have
some information about the remote system's DNS, you could.  

The way the OP worded the assignment, it sounds like a case of a
clueless teacher sharing his wealth of ignorance with a new
generation.  

In the real world, if you've already got a connection, you no longer
care about DNS.  It doesn't matter how you addressed the host, once
you've reached it.  Maybe there are situations, e.g., security related,
where you want a reverse-lookup to some canonical resolution, but in the
general case, since the mapping is arbitrary and can be private, there's
no really good way to do what the OP wants to do.  I would be willing to
give an ear to someone who thinks there's a scenario where this is
necessary, or even workable.  

You want *all* the aliases of a host?  I doubt your program is able to
discern that I call my workstation "broken piece of crap", or more to
the point, that I have private DNS in my lab for naming hosts that have
totally different names to the public.  
Ronny Schuetz - 01 Apr 2006 22:44 GMT
The question was not really related to the OPs question. I was looking
for a general way to get all _public_ aliases a while ago to check X.509
certificates received during SSL handshakes and ran into this issue. Was
just wondering cause what you wrote looked too easy. Trying to get all
CNAME records and compare them on the client side is of course not an
option.

Ronny
Zero - 02 Apr 2006 05:25 GMT
Thank U for all the guys worked on this topic. U are really good and
helpful.
It seems it is necessary for me to talk to my teacher about her foolish
requirement.
Thank U again ^_^
Roedy Green - 01 Apr 2006 19:01 GMT
>I don't know how to get all the alias hostname of an IP address. I have
>looked through the net but got no answer.

see http://mindprod.com/jgloss/ip.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.