Bug#319946: perl-modules: Net::Domain::hostfqdn() returns an incorrect FQDN

2016-09-30 Thread Vincent Lefevre
Control: found -1 5.24.1~rc3-3

On 2006-07-14 22:58:30 +0200, markus koller wrote:
> I was able to solve my problem by putting only the hostname in
> /etc/hostname (just 'snafu' instead of 'snafu.selfip.org').
> hostfqdn() now returns the correct domain.
> 
> A little googling revealed that there's no clear rule whether
> /etc/hostname should contain only the short name or the FQDN, so I
> think perl should work with both, especially as the other commands
> and languages also managed to return the right FQDN.

It seems that putting the short name is the common rule nowadays
(not sure), at least in Debian, but yes, since this is not
mandatory, perl should work with both.

Anyway, even with the short name, it is broken.
Test with 5.24.1~rc3-3:

cventin:~> perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"'
cventin.lip.ens-lyon.fr.

Notice the trailing dot. I suspect that it comes from the "search"
line in:

cventin:~> cat /etc/resolv.conf
# Generated by NetworkManager
search lip.ens-lyon.fr. ens-lyon.fr.
nameserver 140.77.1.32
nameserver 140.77.167.2

And actually, using the "search" line here is wrong because
/etc/hosts has the precedence with the standard resolver, as
specified by my /etc/nsswitch.conf file.

What should be returned: (gethostbyname((POSIX::uname)[1]))[0]

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#319946: perl-modules: Net::Domain::hostfqdn() returns an incorrect FQDN

2006-07-14 Thread markus koller
I was able to solve my problem by putting only the hostname in /etc/hostname
(just 'snafu' instead of 'snafu.selfip.org'). hostfqdn() now returns the correct
domain.

A little googling revealed that there's no clear rule whether /etc/hostname 
should
contain only the short name or the FQDN, so I think perl should work with both,
especially as the other commands and languages also managed to return the right
FQDN.


Cheers,
Markus


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#319946: perl-modules: Net::Domain::hostfqdn() returns an incorrect FQDN

2006-07-13 Thread toupeira
Package: perl-modules
Version: 5.8.8-6
Followup-For: Bug #319946

This seems to really be a bug with Net::Domain, I experience a similar
problem after upgrading to a 2.6.17 kernel, strangely it worked fine
with 2.6.16 (I noticed because munin stopped updating the graphs).

$ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn().\n'
snafu.selfip.selfip.org

The other methods still return correct values:

$ uname -a
Linux snafu.selfip.org 2.6.17-1-686 #1 SMP Thu Jun 29 21:48:36 UTC 2006 i686
GNU/Linux
$ hostname -f
snafu.selfip.org
$ python -c import socket; print socket.gethostname()
snafu.selfip.org
$ ruby -rsocket -e 'puts Socket.gethostname'
snafu.selfip.org

u don't have a search domain in /etc/resolv.conf, resolution is done through
/etc/hosts. The domain is registered at DynDNS, so I think the DNS records
are fine.


Cheers,
Markus


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages perl-modules depends on:
ii  perl  5.8.8-6Larry Wall's Practical Extraction 

perl-modules recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#319946: perl-modules: Net::Domain::hostfqdn() returns an incorrect FQDN

2005-10-31 Thread Vincent Lefevre
I didn't try hostname -d and dnsdomainname. To summarize, with
these results:

ay:~ hostname --fqdn
ay.vinc17.org
ay:~ hostname -s
ay
ay:~ hostname -d
vinc17.org
ay:~ dnsdomainname
vinc17.org

But

ay:~ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn().\n'
ay.local

It is clear that Net::Domain is wrong.

-- 
Vincent Lefèvre [EMAIL PROTECTED] - Web: http://www.vinc17.org/
100% accessible validated (X)HTML - Blog: http://www.vinc17.org/blog/
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#319946: perl-modules: Net::Domain::hostfqdn() returns an incorrect FQDN

2005-07-25 Thread Vincent Lefevre
Package: perl-modules
Version: 5.8.7-3
Severity: normal

All the following methods agree with each other:

ay:~ hostname
ay.vinc17.org
ay:~ uname -n
ay.vinc17.org
ay:~ perl -e 'use Sys::Hostname; print hostname().\n'
ay.vinc17.org

But...

ay:~ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn().\n'
ay.local

In the module, two subroutines are called by domainname:
  _hostname, which gives ay.vinc17.org,
  _hostdomain, which gives local.

IMHO, if _hostname returns a hostname with a dot, then this is the
FQDN and it should be returned without having to call _hostdomain.

A word about my machine:

This is a laptop, which can be connected on various networks (or
be outside of any network). The goal of the FQDN is to identify
the machine and the FQDN must not change when the machine is
moved to a different network (or is connected to two networks
at the same time). As I own a domain name (and control it),
I've given the name ay.vinc17.org (which is not resolvable on
the Internet, but due to the status of the machine, this makes
sense). My machine is currently on a private network at home,
where I set up a local domain local; this is why _hostdomain
returns local.

BTW, it seems that mixing parts of @host and @domain as the module
currently does may give a FQDN of a different machine. For instance,
if I connect my machine to a domain called foo.bar, and there
exists a different machine ay.foo.bar, then returning this FQDN
(formed with the leading part of ay.vinc17.org and the domain name
foo.bar) would be completely wrong.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (900, 'testing'), (900, 'stable'), (200, 'unstable')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-20050618
Locale: LANG=POSIX, LC_CTYPE=en_US.ISO8859-1 (charmap=ISO-8859-1)

Versions of packages perl-modules depends on:
ii  perl  5.8.7-3Larry Wall's Practical Extraction 

perl-modules recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]