[lug] Converting IPs to Domain Names and Vice Versa via Bash

Michael Hirsch mhirsch at nubridges.com
Thu Jan 27 07:48:27 MST 2005


> -----Original Message-----
> From: lug-bounces at lug.boulder.co.us
[mailto:lug-bounces at lug.boulder.co.us]
> On Behalf Of David Anselmi
> Sent: Wednesday, January 26, 2005 11:28 PM
> To: Boulder (Colorado) Linux Users Group -- General Mailing List
> Subject: Re: [lug] Converting IPs to Domain Names and Vice Versa via
Bash
> 
> David Morris wrote:
> [...]
> > As for the IP address being reviersed in the reply of the
> > reverse lookup....that is just the way it is done.  I'm
> > certain there was a good reason at one time but its mostly
> > tradition now I suspect.
> 
> It's a tradition worth sticking to.  I'd have thought CS people would
> take this for granted but I tend to see it done wrong.
> 
> Typically when naming things you put the most general part to the
right.
>   That's the way fw1.cellularonewest.com is, and also
> 3.140.212.65.in-addr.arpa.  In both, the host specific piece is
left-most.
> 
> This usually makes good sense--think about sorting or tab completion
> where you'd probably want to sort by the most specific piece first.
As
> a counter example, here's a real list:
> 
> ismdenf01
> ismdenf02
> ismdenf03
> 
> The first letter is the (federal) department, next two are agency,
next
> 3 are office, and finally server type and number.  Better is:
> 
> f01densmi
> f02densmi
> f03densmi

I find this pretty unconvincing.  If I also have computers in another
agency
ixyztqf01 
ixyztqf02 
ixyztqf03
and I sort these with the original 3 I will see two blocks of computers.
But if I name them your preferred way I get
f01densmi
f01ztqxyz 
f02densmi
f02ztqxyz 
f03densmi
f03ztqxyz

>From a sorting point of view, I'd much prefer sorting the first way.

Maybe I've been doing OO programming too long.  It belongs to a
commercial organization, it is owned by Google, it's name is www, or
com.google.www actually makes more sense to me than www.google.com.

Michael





More information about the LUG mailing list