New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] The zone could not be retrieved from the DNS servers #370

Closed
jovrum opened this Issue Apr 5, 2017 · 7 comments

Comments

Projects
None yet
2 participants
@jovrum

jovrum commented Apr 5, 2017

fM Version : v3.0-beta1
fmDNS Version : v3.0-beta1
Commit : cd2fa13


Hello,

I want to use fM to manage records in a dynamic zone on an existing BIND deployment. After adding the zone (ticking the 'dynamic zone' box) I click on the domain name (with the alt text 'Edit zone records'), and instead of a list of existing records, I get a popup with the title 'Error' and text 'The zone could not be retrieved from the DNS servers.'

I see no log entry referencing this with more information, neither in /var/log/fm.log on the client, nor on the Admin -> Logs page (I have also ticked 'Show Errors' in general settings).

What does this error message mean?

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Apr 5, 2017

What server update method are you using? While looking into this issue, I found some incomplete code which means the only supported update method for dynamic zones is SSH:

			if ($server_update_method == 'ssh') {
				$server_gather_zone = runRemoteCommand($server_name, 'sudo php /usr/local/facileManager/fmDNS/client.php dump-zone -D ' . $domain_name . ' -f ' . $server_chroot_dir . $server_zones_dir . '/master/db.' . $domain_name . '.hosts', 'return', $server_update_port);
				...
			} elseif (in_array($server_update_method, array('http', 'https'))) {
				/** Get zone data via http(s) */
			}

If you're using SSH then we can look more into why you can't retrieve the zone (most likely a filename issue) and if you're using http/https then it's not retrieving because the feature is incomplete which needs to be finished for beta2.

@WillyXJ WillyXJ added the fmDNS label Apr 5, 2017

@WillyXJ WillyXJ added this to the 3.0 release milestone Apr 5, 2017

@jovrum

This comment has been minimized.

jovrum commented Apr 5, 2017

I am indeed using SSH. I'll play around with running that command manually and see which variable might be causing it (e.g. my server chroot dir is blank, at least in the GUI config).

A more descriptive error message, either in the popup or in one of the logs, would be an improvement though.

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Apr 5, 2017

Does your domain filename contain the domain_id in it (i.e. /path/to/zones/master/db.domain.XYZ.hosts)?

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Apr 5, 2017

I dug further into this and you would have received a different error if the command via SSH had failed. The error you received is displayed when the following conditions apply:

  1. There are no active name servers configured to host the zone
  2. All of the name servers configured to host the zone are running a version of fmDNS older than 3.0-alpha1
  3. All of the name servers configured to host the zone do not get updates via SSH (needs to be implemented as previously stated)

Could you please verify the above to see if any apply to your environment?

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Apr 15, 2017

This is now included in the latest beta version and later.

@jovrum

This comment has been minimized.

jovrum commented Apr 19, 2017

Thanks, using the head of 3.0-unstable-dev, I no longer get the error message.

When I click the zone I get a brief 'Pulling the latest zone data from the server...' which seems to succeed. However, when browsing records in the web interface, it doesn't show my existing records, which should include the SOA, a couple of NS records and an A record in my test environment.

When adding the zone in fmDNS I was immediately presented with the "** The SOA record still needs to be created for this zone **" screen. My zone directory is /var/lib/bind (I have configured it in the fmDNS server settings), and my test zone is in a file /var/lib/bind/foo.example.org (filename has no affix like "db"). In the "Add Zone" dialog I put foo.example.org in the "Domain Name" text entry box and selected the server I configured earlier.

Have I configured it correctly for it to import existing records? What should I expect to see when/if it finds the existing zone file? I also tried adding the db. prefix to the zone filename, but I got the same results.

Does your domain filename contain the domain_id in it (i.e. /path/to/zones/master/db.domain.XYZ.hosts)?

I don't think so. What is this?

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Apr 19, 2017

Unlike some other solutions, fmDNS is not designed to directly interact with existing files. It's designed to generate configuration and zone files based on information stored in the database. Adding dynamic zone support brings a little more of the direct interaction to the software though. While it's recommended to Import Zone Files through Admin -> Tools for new installations, your method could work if your zone file is named correctly in the proper directory. The expected path and filename can be found by going to Config -> Servers and click the Preview icon for the server with the zone file. That will give you the filename and absolute path that fmDNS will use. Once you rename your existing file to the given path/name, then when you edit the zone records within fmDNS, you should see a window appear with records it wants to import. However, you won't be able to reload the zone until it's been built on the server defined to host it (through Config -> Servers and then Build Config), but that process will overwrite the existing zone file on the filesystem.

I hope that makes sense and gets you going on testing this feature.

@WillyXJ WillyXJ closed this Jun 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment