Страница 1 из 1

Проблема с zone2sql

Добавлено: 2009-09-14 9:59:37
Perhyar
Прочитал статью про миграцию с BIND на PowerDNS (http://www.lissyara.su/?id=1727)
В принципе все понятно, и хорошо расписано, но...
Почему то сконвертить зоны с конфига байнда -не получается. =(

Код: Выделить всё

============================================================
root@dns:~# zone2sql --named-conf=/etc/bind/named.conf --gmysql > domains.sql

Fatal error: Error in bind configuration '/etc/bind/named.conf' on line 13: syntax error
============================================================




cat /etc/bind/named.cof
============================================================
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";

// prime the server with knowledge of the root servers
view "internal" {
zone "." {   [b]<-------------------------------------------------------------------- это 13 строка(!)[/b]
        type hint;
        file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
============================================================
В инете все обшарил.
Проблема возникает частенько, но ответа как пофиксить -не нашел.

Re: Проблема с zone2sql

Добавлено: 2009-09-15 10:56:24
salimk
У меня такой проблемы не было,
вообще это зона список корневых серверов
если честно для работы она не нужна,
у меня без нее нормальна работает
можешь удалит эти строки чтобы zone2sql их не читало:

Код: Выделить всё

zone "." { <-------------------------------------------------------------------- это 13 строка(!)
type hint;
file "/etc/bind/db.root";
};
ну если тебе не в терпеж это зона нужна
для тебя я его выложу
domains.sql:

Код: Выделить всё

insert into domains (name,type) values ('','NATIVE');
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'A.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'a.root-servers.net', 'A', '198.41.0.4', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'B.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'b.root-servers.net', 'A', '192.228.79.201', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'C.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'c.root-servers.net', 'A', '192.33.4.12', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'D.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'d.root-servers.net', 'A', '128.8.10.90', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'E.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'e.root-servers.net', 'A', '192.203.230.10', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'F.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'f.root-servers.net', 'A', '192.5.5.241', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'G.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'g.root-servers.net', 'A', '192.112.36.4', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'H.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'h.root-servers.net', 'A', '128.63.2.53', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'I.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'i.root-servers.net', 'A', '192.36.148.17', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'J.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'j.root-servers.net', 'A', '192.58.128.30', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'K.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'k.root-servers.net', 'A', '193.0.14.129', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'L.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'l.root-servers.net', 'A', '198.32.64.12', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'', 'NS', 'M.ROOT-SERVERS.NET', 3600000, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id ,'m.root-servers.net', 'A', '202.12.27.33', 3600000, 0 from domains where name='';

Re: Проблема с zone2sql

Добавлено: 2009-09-16 7:59:34
Perhyar
Благодарю.
Корневые добавились на ура, но..
Очень не хотелось бы трогать текущий рабочий конфиг байда, и менять что либо в нем, 20.000 клиентов пользуют сей днс.

Что конкретно конвертирует zone2sql?
Те хосты которые я прописывал руками и забивал в байд типа:

ns IN A 10.0.0.*
ns2 IN A 10.0.0.**
Они тоже попадают в дамп?

Re: Проблема с zone2sql

Добавлено: 2009-09-23 15:35:27
salimk
Не обязательно менять текущую конфигурацию Байнда можно создать копию

#cp /etc/bind/named.conf /etc/bind/named.conf.copy

в файле /etc/bind/named.conf.copy удалит строки, на которые ругается

zone "." {
type hint;
file "/etc/bind/db.root";
};

затем
#zone2sql --named-conf=/etc/bind/named.conf --gmysql > domains.sql

я думаю у тебя не будет с этим проблем

Re: Проблема с zone2sql

Добавлено: 2009-10-06 7:47:56
Gringo
Благодарю :)