Page 1 of 2

Reverse DNS Disabled

Posted: Thu Jun 04, 2020 1:32 pm
by brandon-verrette
Hello,

Whenever exporting the list of unique Host to CSV, the column for host name all say <Reverse DNS disabled>.I cant seem to enable this feature and DNS is properly configured


Any help would be greatly appreciated !

Re: Reverse DNS Disabled

Posted: Thu Jun 04, 2020 5:49 pm
by ssax
If you go to Admin > Global Settings, can you switch it to yes, then save, then switch it to no, then save or are you saying that's not working?

What OS/version are you using?

Please PM me a copy of your profile, you can download it from Admin > System Status by clicking the Download System Profile button.

Re: Reverse DNS Disabled

Posted: Mon Jun 08, 2020 10:45 am
by brandon-verrette
If I change it to yes or no under "Disable Reverse DNS", the exported CSV still says "Reverse DNS Disabled "

Were currently running 2.1.6 and profile has been sent over

Thank you

Re: Reverse DNS Disabled

Posted: Mon Jun 08, 2020 5:12 pm
by ssax
If you grab one of the IP addresses and then run this command from the CLI, what does it output:

Code: Select all

nslookup X.X.X.X

Re: Reverse DNS Disabled

Posted: Tue Jun 09, 2020 3:00 pm
by brandon-verrette
So when I first tried it, I had to install bind-utils to have nslookup

Now when I do nslookup X.X.X.X, It responds with the correct hostname. However, the exported CSV of unique host still says <Reverse DNS disabled>

Ive even tried switching it to yes, then switching it back to no under global config.

Re: Reverse DNS Disabled

Posted: Wed Jun 10, 2020 4:00 pm
by ssax
I'm able to reproduce this now, it's a bug.

First, make sure Disable Reverse DNS is set back to yes.

Then edit this file:

Code: Select all

/var/www/html/nagioslogserver/application/controllers/cli/CLI_Reporting.php
Change this code (around line 82):

Code: Select all

        foreach ($sending as $host => $logs) {
            $ret .= $host . ',' . dns_reverse_lookup($host, true) . ',' . 1 . ",," . $logs . "\n";
        }

        foreach ($not_sending as $host => $time) {
            $ret .= $host . ',' . dns_reverse_lookup($host, true) . ',' . 0 . ',' . $time . ",\n";
        }
To this:

Code: Select all

        foreach ($sending as $host => $logs) {
            $ret .= $host . ',' . dns_reverse_lookup($host) . ',' . 1 . ",," . $logs . "\n";
        }

        foreach ($not_sending as $host => $time) {
            $ret .= $host . ',' . dns_reverse_lookup($host) . ',' . 0 . ',' . $time . ",\n";
        }
Does that resolve it for you?

Re: Reverse DNS Disabled

Posted: Tue Jun 16, 2020 8:58 am
by brandon-verrette
Unfortunately, that did not work for me. When I made the following changes, the CSV no longer has any value in the Hostname field.

Code: Select all

       foreach ($sending as $host => $logs) {
            $ret .= $host . ',' . dns_reverse_lookup($host) . ',' . 1 . ",," . $logs . "\n";
        }

        foreach ($not_sending as $host => $time) {
            $ret .= $host . ',' . dns_reverse_lookup($host) . ',' . 0 . ',' . $time . ",\n";
        }

Re: Reverse DNS Disabled

Posted: Tue Jun 16, 2020 4:28 pm
by ssax
It would be blank for ones that it's unable to get the DNS entries for. It's not showing for any of them?

If you grab the IP address from one of the hosts not listing anything in the CSV and run this command it returns everything properly?
nslookup X.X.X.X

Re: Reverse DNS Disabled

Posted: Tue Jun 16, 2020 4:29 pm
by cdienger
Looks like a bug but probably different than the one we previously thought. I was able to reproduce it and it seems like once the option to disable DNS is enabled it properly disable it. You can disable it by running this from the command line:

Code: Select all

curl -XDELETE http://localhost:9200/nagioslogserver/cf_option/disable_reverse_dns

Re: Reverse DNS Disabled

Posted: Thu Jun 18, 2020 7:57 am
by brandon-verrette
Enabling the Disable DNS followed by the delete command seemed to have worked.

Code: Select all

curl -XDELETE http://localhost:9200/nagioslogserver/cf_option/disable_reverse_dns
Thank you !