Mailing List Archive

Re: Perlbug v1.03
I wanted to suggest a patch to lib/Sys/Hostname.pm that removes
".foo.rome.de" on the machine in question. E.g.

*** Sys/Hostname.pm.5.001m Tue Aug 15 17:23:48 1995
--- Sys/Hostname.pm Tue Aug 15 17:24:05 1995
***************
*** 47,52 ****
--- 47,53 ----

# remove garbage
$host =~ tr/\0\r\n//d;
+ $host =~ s/\..*//;
$host;
}


Good idea to remove leading dots beforehand, though.

why ? if my host name if 'foo.bar.baz', then, 'foo.bar.baz' is
my hostname. if it is just 'foo', then, my hostname is 'foo'.

.mrg.
Re: Perlbug v1.03 [ In reply to ]
On Mon, 28 Aug 1995, matthew green wrote:

> Good idea to remove leading dots beforehand, though.
>
> why ? if my host name if 'foo.bar.baz', then, 'foo.bar.baz' is
> my hostname. if it is just 'foo', then, my hostname is 'foo'.

But if I get "foo..bar.baz" out of a weird concatenation then that
doesn't do any good. Also, your system _might_ also be called
"foo.bar.baz.", but it's unclear whether we want the terminal dot.

> .mrg.

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
Re: Perlbug v1.03 [ In reply to ]
On Mon, 28 Aug 1995, matthew green wrote:

> Good idea to remove leading dots beforehand, though.
>
> why ? if my host name if 'foo.bar.baz', then, 'foo.bar.baz' is
> my hostname. if it is just 'foo', then, my hostname is 'foo'.

But if I get "foo..bar.baz" out of a weird concatenation then that
doesn't do any good. Also, your system _might_ also be called
"foo.bar.baz.", but it's unclear whether we want the terminal dot.

actually, the 'why' wasn't aimed at the text you quoted, but, rather
this:

I wanted to suggest a patch to lib/Sys/Hostname.pm that removes
".foo.rome.de" on the machine in question. E.g.

i agree with removing leading/trailing dots from a hostname or
domainname.

.mrg.
Re: Perlbug v1.03 [ In reply to ]
On Mon, 28 Aug 1995, matthew green wrote:

>
> On Mon, 28 Aug 1995, matthew green wrote:
>
> > Good idea to remove leading dots beforehand, though.
> >
> > why ? if my host name if 'foo.bar.baz', then, 'foo.bar.baz' is
> > my hostname. if it is just 'foo', then, my hostname is 'foo'.
>
> But if I get "foo..bar.baz" out of a weird concatenation then that
> doesn't do any good. Also, your system _might_ also be called
> "foo.bar.baz.", but it's unclear whether we want the terminal dot.
>
> actually, the 'why' wasn't aimed at the text you quoted, but, rather
> this:
>
> I wanted to suggest a patch to lib/Sys/Hostname.pm that removes
> ".foo.rome.de" on the machine in question. E.g.
>
> i agree with removing leading/trailing dots from a hostname or
> domainname.

Shoot, that's the second time I've done that. I keep getting confused
over whether people are talking about hostnames meaning FQDN's or
hostnames meaning the name of the machine without any domain at all. Sorry.

> .mrg.
>

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
Re: Perlbug v1.03 [ In reply to ]
On Mon, 28 Aug 1995, Andreas Koenig wrote:

>
> Andreas Koenig:
> >> I wanted to suggest a patch to lib/Sys/Hostname.pm that removes
> >> ".foo.rome.de" on the machine in question. E.g.
> >>
> Matthew Green:
> >> i agree with removing leading/trailing dots from a hostname or
> >> domainname.
> >
> Kenneth Albanowski:
> >Shoot, that's the second time I've done that. I keep getting confused
> >over whether people are talking about hostnames meaning FQDN's or
> >hostnames meaning the name of the machine without any domain at all. Sorry.
>
> You're not to blame, there is no definition as far as I know. I have
> tested about 10 installations and all but one respond to
> Hostname::hostname() with a name that doesn't contain a dot.
>
> Perl is designed to be portable, and has to find common denominators
> for operating systems, networks, and administrators =:^<, so maybe
> should provide it's own definition of what Hostname::hostname() is
> expected to return.
>
> I withdraw my suggestion above. I had not thought enough about it. I
> still have no idea how a bullet-proof way to get the FQDN of a system
> in perl would look like.

Well, I think a good starting point is that a mail domain _must_ have a
hostname, otherwise it's useless as a location to hook SMTP up to.

If we want to play with terminology, I personally would like most for
Hostname to be the name of the computer without a dot, Domainname to be
the complete domain, with `hostname` and `domainname`, and that something
else (Hostdomain, perhaps?) to be the domain name without the host
prepended. That would seem to make the most sense.

> andreas

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
Re: Perlbug v1.03 [ In reply to ]
Andreas Koenig:
>> I wanted to suggest a patch to lib/Sys/Hostname.pm that removes
>> ".foo.rome.de" on the machine in question. E.g.
>>
Matthew Green:
>> i agree with removing leading/trailing dots from a hostname or
>> domainname.
>
Kenneth Albanowski:
>Shoot, that's the second time I've done that. I keep getting confused
>over whether people are talking about hostnames meaning FQDN's or
>hostnames meaning the name of the machine without any domain at all. Sorry.

You're not to blame, there is no definition as far as I know. I have
tested about 10 installations and all but one respond to
Hostname::hostname() with a name that doesn't contain a dot.

Perl is designed to be portable, and has to find common denominators
for operating systems, networks, and administrators =:^<, so maybe
should provide it's own definition of what Hostname::hostname() is
expected to return.

I withdraw my suggestion above. I had not thought enough about it. I
still have no idea how a bullet-proof way to get the FQDN of a system
in perl would look like.

andreas
Re: Perlbug v1.03 [ In reply to ]
>>>>> "Kenneth" == Kenneth Albanowski <kjahds@kjahds.com> writes:

Kenneth> Well, I think a good starting point is that a mail domain _must_ have a
Kenneth> hostname, otherwise it's useless as a location to hook SMTP up to.

No. Could be strictly an MX record.

Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
Re: Perlbug v1.03 [ In reply to ]
On Mon, 28 Aug 1995, Randal L. Schwartz wrote:

> >>>>> "Kenneth" == Kenneth Albanowski <kjahds@kjahds.com> writes:
>
> Kenneth> Well, I think a good starting point is that a mail domain _must_ have a
> Kenneth> hostname, otherwise it's useless as a location to hook SMTP up to.
>
> No. Could be strictly an MX record.

Good point. So should the terminology work out this way:

A Hostname is the name of the local machine. No dots, no separators,
just a single name.

A Domain is the complete Unix name of some site, including traditional
host and domain parts. This may be an MX record, or the name of an actual
site, but it should be usable as-is to address a particular site.

A Hostdomain is domain that a particular machine lives in. When the
Hostname is preprended to this, you get a proper Domain.

Hmm. Maybe we should have Hostname's, Domain's, and Address'? "Sites",
maybe?

The main point is that in all likelyhood the complete "Domain" as I call
it here is going to be of more use then the "Hostdomain".

> Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
> Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
> Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
> Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>
> Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
>

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
Re: Perlbug v1.03 [ In reply to ]
On Mon, 28 Aug 1995, Tom Christiansen wrote:

> > On Mon, 28 Aug 1995, Randal L. Schwartz wrote:
>
> > > >>>>> "Kenneth" == Kenneth Albanowski <kjahds@kjahds.com> writes:
> > >
> > > Kenneth> Well, I think a good starting point is that a mail domain _must_ have a
> > > Kenneth> hostname, otherwise it's useless as a location to hook SMTP up to.
> > >
> > > No. Could be strictly an MX record.
>
> > Good point. So should the terminology work out this way:
>
> > A Hostname is the name of the local machine. No dots, no separators,
> > just a single name.
>
> don't think so. I can set my hostname to things iwth dots just fine.

This is the problem. I'm not talking about `hostname`, I'm talking about a
hypothetical set of ideal Hostname, and Domainname functions. Just
deciding on what a hostname and domainname is seems to be a problem.

> --toim

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
Re: Perlbug v1.03 [ In reply to ]
> On Mon, 28 Aug 1995, Randal L. Schwartz wrote:

> > >>>>> "Kenneth" == Kenneth Albanowski <kjahds@kjahds.com> writes:
> >
> > Kenneth> Well, I think a good starting point is that a mail domain _must_ have a
> > Kenneth> hostname, otherwise it's useless as a location to hook SMTP up to.
> >
> > No. Could be strictly an MX record.

> Good point. So should the terminology work out this way:

> A Hostname is the name of the local machine. No dots, no separators,
> just a single name.

don't think so. I can set my hostname to things iwth dots just fine.

--toim
Re: Perlbug v1.03 [ In reply to ]
On Tue, 29 Aug 1995, Graham Barr wrote:

> I agree with this but I would like to point out one thing. Currently
> Hostname and Domainname are contained in different packages.
>
> Creating a Sys::Hostdomain seems a bit extreem. I would like to suggest
> that these three functions are combined into 1 package (in such a way
> that it allows backwards compatability)

Fine with me.

> I would suggest that all 3 functions are placed into Sys::Hostname
> as there are already a lot of package that use Hostname::hostname
> as it has been around a while but Sys::Domainname is very new.
>
> A few other suggestions could be
>
> Sys::Name
> Sys::DNS
> Sys::Domainname
> Sys::Hostdomain

I'd suggestion Sys::Domains.

> But Sys::Hostname would probably need to exists for backwards compatability
>
> BTW who is that maintainer of Sys::Hostname ?
>
> Regards,
> Graham.
>
> --
> .-----------------------------------------------------------.
> //// | Graham Barr Email: bodg@tiuk.ti.com | \\\\
> | 00 | VLSI Cell Designer or: bodg@ti.com | 00 |
> O ^ | MOS Design TI MSG: BODG | ^ O
> \ ~/ | Texas Instruments Ltd Phone: +44 (0)1604 66 3419 | \~ /
> | ENGLAND Fax: +44 (0)1604 66 3456 |
> `-----------------------------------------------------------'
>
>

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
Re: Perlbug v1.03 [ In reply to ]
In <Pine.LNX.3.91.950828013319.468H@kjahds.com>
On Mon, 28 Aug 1995 01:35:58 -0400 (EDT)
Kenneth Albanowski <kjahds@kjahds.com> writes:
>On Mon, 28 Aug 1995, Andreas Koenig wrote:
>
>>

...

>>
>> I withdraw my suggestion above. I had not thought enough about it. I
>> still have no idea how a bullet-proof way to get the FQDN of a system
>> in perl would look like.
>
>Well, I think a good starting point is that a mail domain _must_ have a
>hostname, otherwise it's useless as a location to hook SMTP up to.
>
>If we want to play with terminology, I personally would like most for
>Hostname to be the name of the computer without a dot, Domainname to be
>the complete domain, with `hostname` and `domainname`, and that something
>else (Hostdomain, perhaps?) to be the domain name without the host
>prepended. That would seem to make the most sense.

I agree with this but I would like to point out one thing. Currently
Hostname and Domainname are contained in different packages.

Creating a Sys::Hostdomain seems a bit extreem. I would like to suggest
that these three functions are combined into 1 package (in such a way
that it allows backwards compatability)

I would suggest that all 3 functions are placed into Sys::Hostname
as there are already a lot of package that use Hostname::hostname
as it has been around a while but Sys::Domainname is very new.

A few other suggestions could be

Sys::Name
Sys::DNS
Sys::Domainname
Sys::Hostdomain

But Sys::Hostname would probably need to exists for backwards compatability

BTW who is that maintainer of Sys::Hostname ?

Regards,
Graham.

--
.-----------------------------------------------------------.
//// | Graham Barr Email: bodg@tiuk.ti.com | \\\\
| 00 | VLSI Cell Designer or: bodg@ti.com | 00 |
O ^ | MOS Design TI MSG: BODG | ^ O
\ ~/ | Texas Instruments Ltd Phone: +44 (0)1604 66 3419 | \~ /
| ENGLAND Fax: +44 (0)1604 66 3456 |
`-----------------------------------------------------------'
Re: Perlbug v1.03 [ In reply to ]
what happens if:

host = foo.bar
domain = baz.com

giving a FQDN of foo.bar.baz.com ?

you shouldn't remove any parts of a hostname. if i have set my
hostname to be x.y.z, then, i want _that_ returned as my hostname.

.mrg.