Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Getting the FQDN using Net::Domain

by nickolsen (Initiate)
on Jan 26, 2012 at 09:30 UTC ( [id://950056]=note: print w/replies, xml ) Need Help??


in reply to Re: Getting the FQDN using Net::Domain
in thread Getting the FQDN using Net::Domain

Thanks for your reply and especially for mentioning the bug report.

How exactly?
As you can see in my example (and in the bugreport):
The "search" block contains only the local domain part by default, but it can be changed to whatever suits your needs. Therefor the module relies on information which might be right but don't have to be.

Sys::Hostname is not an option for me, as I need to know the FQDN and not only the host-part of the hostname. It calls "uname -n" [0], which does not have to know the domain-part.

Here's another example:
mobile:~# head -n2 /etc/resolv.conf domain example.org search intern.example.org example.org mobile:~# python -c 'import socket; print socket.getfqdn();' mobile.example.org mobile:~# hostname -f mobile.example.org mobile:~# perl -e 'use Net::Domain qw/ hostfqdn /; print(hostfqdn . "\ +n");' mobile.intern.example.org mobile:~# perl -e 'use Sys::Hostname; print(hostname . "\n");' mobile

Anyways, the bug report completely describes my issue, so maybe things will get fixed soon.

[0]: http://www.kernel.org/doc/man-pages/online/pages/man2/uname.2.html

Replies are listed 'Best First'.
Re^3: Getting the FQDN using Net::Domain
by Anonymous Monk on Jan 26, 2012 at 09:37 UTC

    Anyways, the bug report completely describes my issue, so maybe things will get fixed soon.

    Sure, if soon you mean 1 month to 3 or more years :)

    Might get fixed quicker if you fork https://github.com/gbarr/perl-libnet

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://950056]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-23 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found