No output from command "dnsdomainname"

I ran lynis the other day and found this warning output:

Performing test ID NAME-4028 (Check domain name)
Test: Checking if dnsdomainname command is available
Result: dnsdomainname command returned no value
Result: using domain name from FQDN hostname (maxpc)
Suggestion: Check DNS configuration for the dns domain name [test:NAME-4028] [details:-] [solution:-]

I tried to solve it, however the command


gave no output.

Lynis also says:

Check DNS configuration for the dns domain name [NAME-4028]
Lynis control NAME-4028: DNS domain name - CISOfy

How do I fix this warning in lynis?

set the fully qualified system name in /etc/hosts

1 Like

thanks man. It seems that my /etc/hosts looks normal. I don’t know why lynis is complaining.
it just says:
/etc/hosts: localhost

maybe I need to add my DNS nameservers in there as well and name them?

Just a note here … the header of my hosts file looks like this:       localhost.localdomain   localhost       $HOSTNAME
::1 localhost.localdomain       localhost       $HOSTNAME broadcasthost
# Fixes a display anomaly in traceroute and netstat

(where $HOSTNAME is the systems actual hostname like “mypc”)