nickolsen has asked for the wisdom of the Perl Monks concerning the following question:
The comment says, that trying to look up the domainname in /etc/resolv.conf is done toreturn $domain = $NetConfig{'inet_domain'} if defined $NetConfig{'inet +_domain'};
... eliminate(s) calls to gethostbyname, and therefore DNS lookups. ...Why not just ask "gethostbyname" (or, as the man-page [0] recommends: a non-obsolete variant) and leave it to the user to configure their name resolution the best possible way?
the module would say, that the hostdomain is "internal.example.org" though the real hostdomain was e.g. "example.org".[...] domain example.org search internal.example.org example.org [...]
...So if I see that correctly, relying on an entry in the "search" block is a bit risky, isn't it?
search
The search list is normally determined from the local domain name; by default, it contains only the local domain name. This may be changed by listing the desired domain search path following the search keyword with spaces or tabs separating the names.
...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting the FQDN using Net::Domain
by Anonymous Monk on Jan 26, 2012 at 02:12 UTC | |
by nickolsen (Initiate) on Jan 26, 2012 at 09:30 UTC | |
by Anonymous Monk on Jan 26, 2012 at 09:37 UTC |