jethrocarr / namedmanager

AGPL web-based DNS management interface in PHP
349 stars 126 forks source link

How do you reset a nameserver? #61

Open zubfatal opened 7 years ago

zubfatal commented 7 years ago

I noticed my secondary nameserver gave weird results (no soa etc) even locally, maybe because i forgot to set $config["bind"]["zonefullpath"] = "on"; in config-bind.php which I did on the primary, and that one responds just fine. So, I changed the config, emptied named.namedmanager.conf and removed the zone files manually - I've even tried resetting api_sync_config field in the name_servers table for the server, but no zone files are written, not added to named.namedmanager.conf either.

The cron-scripts are running, but no errors thrown.

zubfatal commented 7 years ago

Not sure what you were trying to achieve here at line 114 in namedmanager_bind_configwriter.php but this fixes the issue: Change if (!$config_version = $obj_bind_api->check_update_version()) to if (!$config_version == $obj_bind_api->check_update_version()) (note the ==, $config_version didn't seem to be defined elsewhere?)

At least now it writes the named.namedmanager.conf file on each execution..

UPDATE The server remained as "status_unsynched" even though it was actually synched, probably because of I reset the api_sync_config earlier - not sure, reverted the change in line 114, re-added the nameserver and it seems to work again, although I'm still looking for how to reset/resume the nameserver properly @jethrocarr

zubfatal commented 7 years ago

This seems to be the fix in the database: UPDATE name_servers SET api_sync_config=1 WHERE server_name='<NAMESERVER NAME>';