Track. Automate. Configure.

Home About Features Community Develop
Download this project as a tar.gz file

build_bind and trailing dot in FQDN

20-06-2011 08:47:14


I'm trying to use the build_bind module. When launching the script from command line, I get an error :

ERROR => Unable to determine domain list for server named

In this script, this is the following command which produces the error :

$DCM_PATH -r build_bind_server_domain_list server=$SRV_FQDN

The $SRV_FQDN variable is the result of the `hostname -f` command. If I launch it on my server I get "", without the trailing dot. I tried to force the value of $SRV_FQDN in the build_bind script but I got the same result.

I also tried to launch the command above manually and I get my domains correctly :

./ -r build_bind_server_domain_list server=`hostname -f`

Any explaination why the build_bind script modify the hostname ? And how can I bypass this ?

Thanks for your answer.


20-06-2011 22:26:49

So there are some pre-requisite bits of information that need to be stored in ONA for the build script to work.

First off the build script expects a host to be defined in ONA. The default behavior is to use the output of 'hostname -f' to then look for a host defined in ONA with that exact name. It should be the "primary dns name" of the host. Once you have added this host/server to ONA you must then associate the DNS domains that this DNS server should serve DNS for. This is done by clicking on the DNS line under the "Managed services on this host" box in the host detail for that server. You can then associate existing DNS domains to the sever and select if they are master/slave/forwarder etc.

Once you have done that, you should then start to see example configuration files when you view the domain server pages or the domain pages..

I believe this is what you would need to do. Another thing to try is to manually run the command to see if you get proper output from it. It would look something like this:

/opt/ona/bin/ -r build_bind_server_domain_list

21-06-2011 00:45:40

My host is defined correctly in ONA. As I said in my last post, if I launch manually with the hostname of my server, it's ok. But If I launch the build_bind script, I obtain the error message.

The server is defined as a DNS server and is a master for a domain. Here is the "conf" showed in the GUI on the server details page :

# Named.conf file for built on Jun 21st, 8:35am
# TOTAL DOMAINS (count=2)

zone "" in {
type master;
file "/GUI-only-path/";

zone "" in {
type master;
file "/GUI-only-path/";

The question is : why the build_bind script adds a trailing dot to the server hostname causing the script not finding correspondance in its database ?

21-06-2011 00:55:56

Update : the trailing dot is not the problem.. I didn't see it was added by the echo message.. I was misled by the trailing dot DNS notion..

DOMAIN_LIST=`$DCM_PATH -r build_bind_server_domain_list server=$SRV_FQDN` || abend "Unable to determine domain list for server named $SRV_FQDN."

So, I really don't know why the script works fine when launching by hand with the server name, and why it doesn't when called by the build_bind with the same server name..


21-06-2011 10:51:38

well I just plain missed that you did do what I suggested already.. sorry bout that :)

yep this is a strange one.. if you can run the command directly then it should all work. It sounds more like it could be an issue of the shell and its environment possibly?

One other thing to suggest is to put ONA into debug mode.. go to admin->system config and set debug to something like 5.. that should then dump a bunch more into /var/log/ona.log. I'd compare how it looks when you manually run it vs when you run via the script..

You might also just paste "$DCM_PATH -r build_bind_server_domain_list server=$SRV_FQDN" just prior to the DOMAIN_LIST=...... line and it may echo some more error messages to the screen that could help.

another random thought is you might change the first line to be /bin/bash instead of /bin/sh.. though that really shouldnt matter too much.

22-06-2011 02:46:04

You got it !

Placing the command before the $DOMAIN_LIST variable attribution gave me some useful informations : the problem was simply because the sys_build user has a password set whereas the build_bind script try to connect without pass...

Thanks for your help, I can now testing further.