5.2.1.1. get_domainname¶
-
mfutil.net.
get_domainname
(use_resolv_conf=True, resolv_conf_file='/etc/resolv.conf')[source]¶ Get the domain name of the server.
The domain name does not include the hostname.
We try first with the getfqdn method then with the resolv.conf file because the domain can be found here.
- Parameters
use_resolv_conf (boolean) – if set to True, we use the resolv.conf file.
resolv_conf_file (string) – full path of the resolv.conf file (useful for unit testing).
- Returns
the domain name of the server (or None if we can’t find it)
- Return type
string