URL to IP address conversion?

URL to IP address conversion?

Post by BACart » Thu, 28 Jan 1999 04:00:00



My UNIX system has web access but we do not use a name server so to ftp from a
site I must but in the dotted decimal address.  How do I find the dotted
decimal address for sites that I only have the URL for?  I am running AIX 3.2.5
on an RS6000.  Thanks in advance for your assistance.

Brian Carter

 
 
 

URL to IP address conversion?

Post by Christopher Schul » Fri, 29 Jan 1999 04:00:00


This is not a web server issue, but a DNS issue.  To find the ip
address of a 'url' you must talk to a name server that has this
information stored in its database.  

That's what name servers do: they map easy to remember names to hard
to remember ip addresses. (I could argue that at times an ip address
is easier to remember than a long host, but that's not the point of
this..)

The unix tool 'nslookup' will find this information for you.  But, to
use it you need to talk to a name server.  Since you do not have one
locally (I don't understand why not?) you'll have to use someone
else's.

One easy to remember name server (of many many thousands out there) is
ns.mr.net.  The ip address of this machine is currently 137.192.240.5.

So if you want to find the ip address for ftp.microsoft.com, you could
type this at your unix prompt:


137.192.240.5

Which produces the output:

Server:  NIC.MR.Net
Address:  137.192.240.5

Non-authoritative answer:
Name:    ftp.microsoft.com
Address:  198.105.232.1

In other words the server at 137.192.240.5 says that ftp.microsoft.com
lives at 198.105.232.1.

Your version of nslookup may act somewhat differently, so you may have
to look at the docs.

You could also issue this command:


a

Which says: "look at the server 137.192.240.5 for the A record that
identifies ftp.microsoft.com"

This command produces a lot more output:


; (1 server found)
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10
;; flags: qr rd ra; Ques: 1, Ans: 1, Auth: 4, Addit: 4
;; QUESTIONS:
;;      ftp.microsoft.com, type = A, class = IN

;; ANSWERS:
ftp.microsoft.com.      63839   A       198.105.232.1

;; AUTHORITY RECORDS:
MICROSOFT.com.  118913  NS      ATBD.MICROSOFT.com.
MICROSOFT.com.  118913  NS      DNS1.MICROSOFT.com.
MICROSOFT.com.  118913  NS      DNS4.CP.MSFT.NET.
MICROSOFT.com.  118913  NS      DNS5.CP.MSFT.NET.

;; ADDITIONAL RECORDS:
ATBD.MICROSOFT.com.     170843  A       131.107.1.7
DNS1.MICROSOFT.com.     170843  A       131.107.1.240
DNS4.CP.MSFT.NET.       119596  A       207.46.138.11
DNS5.CP.MSFT.NET.       119596  A       207.46.138.12

;; Total query time: 78 msec
;; FROM: genocide to SERVER: 137.192.240.5
;; WHEN: Wed Jan 27 18:11:05 1999
;; MSG SIZE  sent: 35  rcvd: 215

But what you want is under the "ANSWERS" section.  See where it names
ftp.microsoft.com as 198.105.232.1?  That's the same answer we got
from nslookup.

This is all very basic stuff that any unix administrator should know
without question.  I suggest you study up from the book "DNS and BIND"
from O'Reilly.  It's a wonderful introduction to DNS, as well as a
great reference book for all the examples it has inside.


>My UNIX system has web access but we do not use a name server so to ftp from a
>site I must but in the dotted decimal address.  How do I find the dotted
>decimal address for sites that I only have the URL for?  I am running AIX 3.2.5
>on an RS6000.  Thanks in advance for your assistance.

>Brian Carter


--
Christopher Schulte

Replace usenet with chris to send mail.

will *never* get to me. I hate spam!

 
 
 

1. IP address to name conversion... How?

I'd like to know how this is done and if there is a program that
would do this for me.
I know nslookup will do a name to IP address conversion, but how
about vice versa?

---
=====================================================================
John Eichelberger                           SMC #2406  
Elec Eng Dept.   (09-94)                    2 University Circle  
(408) 656-3378  (AV:978)                    Naval Postgraduate School


2. SCO libraries on Linux??

3. Conversion between IP addresses (string and long int)

4. 64bit question

5. IP address string conversion

6. Decaview G387 modelines

7. tell the difference between url and ip address

8. methods to operate on instances of class ``Path'', was: path utility functions

9. IP Address - URL problem

10. Allow URL only for a range of IP address

11. pinging two different URLs, response comes from same IP address (server), Is that possible?

12. Changing IP address on Solaris 9 with multiple virtual IP addresses

13. WANTED: pingmac <IP ADDR> which returns <MAC ADDRESS of IP ADDRESS>