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

Error while trying to build named.conf for a server #60

Closed
chamambom opened this Issue Jan 11, 2014 · 17 comments

Comments

Projects
None yet
2 participants
@chamambom

chamambom commented Jan 11, 2014

Notice: Undefined offset: 0 in /var/www/html/facileManager/server/fm-modules/fmDNS/classes/class_buildconf.php on line 204
Your named configuration contains one or more errors:

/etc/named.conf:22: expected IP address or IPv4 prefix near '{'
/etc/named.conf:22: expected network prefix near '{'

i disabled my options file parameters as i suspected that the error was coming from there but the issue is still there ,can you point me to the right direction

and by the way im using the latest version of fmdns

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jan 11, 2014

Hi,

What is line 22 of your /etc/named.conf?

@chamambom

This comment has been minimized.

chamambom commented Jan 12, 2014

this is what i got and for all the configs that are here ,its only options parameters unless if its checking my currently running named.conf

/etc/named.conf.keys:

// This file was built using fmDNS 1.0.2 on Sun, 12 Jan 2014 8:39 AM Africa/Harare

key rndc-key. {
algorithm hmac-md5;
secret "DzFVvlIZMpHxxxxxxxxxxxx";
};

/etc/named.conf:

// This file was built using fmDNS 1.0.2 on Sun, 12 Jan 2014 8:39 AM Africa/Harare

options {
directory "/var/named";
version none;
hostname none;
recursion no;
statistics-file "/var/named/named.stats";
zone-statistics yes;
pid-file "/var/named/named.pid";
dump-file "/var/named/named.dump";
auth-nxdomain no;
cleaning-interval 120;
interface-interval 0;
allow-query { any; };
listen-on { any; };
recursive-clients 20000;
allow-recursion { trusted; };
query-source address * port 53;
};

server {
keys { "rndc-key."; };
};
server x.x.x.x {
keys { "rndc-key."; };
};
server x .x .x.x{
keys { "rndc-key."; };
};

include "/etc/named.conf.keys";

acl "trusted" {
xxxxxx;
xxxxxx;
xxxxxx;
xxxxxx;
xxxxxx;
xxxxxxx;
};

@chamambom

This comment has been minimized.

chamambom commented Jan 12, 2014

i think i figured the error ...i disabled all the options parameters and
finally managed to isolate the issue to the defined key .the moment i
disable it that error does come out and whenever i enable it it comes back
again

On Sat, Jan 11, 2014 at 5:10 PM, WillyXJ notifications@github.com wrote:

Hi,

What is line 22 of your /etc/named.conf?


Reply to this email directly or view it on GitHubhttps://github.com//issues/60#issuecomment-32098374
.

@chamambom

This comment has been minimized.

chamambom commented Jan 12, 2014

finally managed to identify the error source ,whenever i enable the key ,the problem appears and when i disable it ,the error disappears , can this be fixed by looking into the source code

@chamambom

This comment has been minimized.

chamambom commented Jan 12, 2014

actually its defining the key fields twice as shown below

server {
keys { "rndckey."; };
};
server 41.221.144.10 {
keys { "rndckey."; };

where the first one doesnt include the ip4 address

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jan 12, 2014

I've been able to reproduce this by creating one key and assigning it to two servers. I'll get a fix for 1.0.3.

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jan 12, 2014

Actually, one of my test hosts did not have a fqdn and that's the one that came up empty in the config. The 'server' statement requires an IP address so fmDNS attempts to do a DNS query to resolve the A address. The one that is empty for you, does the server name defined have a fqdn (ie is the hostname 'dnsserver.domain.com' or just 'dnsserver')?

@chamambom

This comment has been minimized.

chamambom commented Jan 13, 2014

all of my servers have a FQDN ,the first one is alvxxn.ai.co.zw and the sec one pixxochio.ai.co.zw and like all the other 4

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jan 13, 2014

Are they all resolvable by your facileManager server?

@chamambom

This comment has been minimized.

chamambom commented Jan 13, 2014

yes they are and the facilemanager server is a dns ITSELF

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jan 13, 2014

Would you mind applying change 32a61bf to your facileManager server, preview the config build for a server, and report back the results? The change will tell you what server hostnames are not resolvable by fmDNS. I'm not sure if this is the right approach, but that's why I'd like to see what your results are.

@chamambom

This comment has been minimized.

chamambom commented Jan 13, 2014

seems like its failing to resolve the first one but seems like its now working ... but i have one more question ...why does it add all the servers using the key to the preview of one server

@chamambom

This comment has been minimized.

chamambom commented Jan 13, 2014

for example preview of one server gives server

197.221.160.181 {
keys { "rndckey."; };
};
server 41.221.159.50 {
keys { "rndckey."; };
};
server 41.221.144.10 {
keys { "rndckey."; };
};

I thought the preview was supposed to give me at least that specific server providing the key

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jan 13, 2014

It's working now? Did you change a hostname in your environment to get a loadable configuration?

fmDNS uses keys for TSIG (Transaction SIGnatures) which requires the DNS server to know what key to use to communicate with a respective DNS server. You can read more about it at http://www.bind9.net/manual/bind/9.3.2/Bv9ARM.ch04.html#tsig

Are you trying to use keys in a different manner?

@chamambom

This comment has been minimized.

chamambom commented Jan 13, 2014

there was one DNS server with a non loadable hostname so i fixed that one first ...and as for the keys i understand how they work and my question was centered around ......lets say i preview a config of one DNS server ,isnt the key supposed to be one ...for the specific server e.g

server 41.221.159.50 {
keys { "rndckey."; };
};

when i have just previewed for the server 41.221.159.50

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jan 13, 2014

Actually you would have a server definition (with a key) for all servers except the one your preview/build. Taken from the aforementioned manual:

Since keys are shared between two hosts only, the server must be told when keys are to be used. The following is added to the named.conf file for host1, if the IP address of host2 is 10.1.2.3:

server 10.1.2.3 {
keys { host1-host2. ;};
};

@chamambom

This comment has been minimized.

chamambom commented Jan 13, 2014

Noted.Tested and now working

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