Linux Domain Name Returns None. I have the NS record type the SOA record type and then all the PTR for the computers on the domain. Please note that if etchostname file does not exist on Ubuntu Linux the host name is set by a reverse DNS query when the network interface gets an IP address assigned.
However if you call the function then domainname will return the empty string. Always set a hostname. If your output is blank then you have to the setup domain name for your server.
It means that the answer you got for your DNS query is coming for a non-authoritative source.
It means that the answer you got for your DNS query is coming for a non-authoritative source. How to setup FQDN in Linux. You can use hostname -d command as well to get the host domainname. Youre likely facing a configuration problem rather than a library one.