khalahan / namecointobind Goto Github PK
View Code? Open in Web Editor NEWNamecoinToBind is a php script that generates bind zones for .bit domains from the namecoin blockchain by using the name_scan rpc command.
NamecoinToBind is a php script that generates bind zones for .bit domains from the namecoin blockchain by using the name_scan rpc command.
got everything up and running great, but I had to manually remove these names from the zone in order to get named running. should we create some kind of filter in namescan.php for these or ....
db.namecoin.bit:17: -.bit: bad owner name (check-names)
db.namecoin.bit:18: *.-.bit: bad owner name (check-names)
db.namecoin.bit:30: --.bit: bad owner name (check-names)
db.namecoin.bit:31: *.--.bit: bad owner name (check-names)
db.namecoin.bit:100: .bit: bad owner name (check-names)
db.namecoin.bit:101: *..bit: bad owner name (check-names)
db.namecoin.bit:209: n-.bit: bad owner name (check-names)
db.namecoin.bit:210: n-.bit: bad owner name (check-names)
db.namecoin.bit:211: www.n-.bit: bad owner name (check-names)
db.namecoin.bit:1905: exa-.bit: bad owner name (check-names)
db.namecoin.bit:1906: exa-.bit: bad owner name (check-names)
db.namecoin.bit:1907: www.exa-.bit: bad owner name (check-names)
db.namecoin.bit:2767: non-.bit: bad owner name (check-names)
db.namecoin.bit:2768: non-.bit: bad owner name (check-names)
db.namecoin.bit:2769: www.non-.bit: bad owner name (check-names)
db.namecoin.bit:2968: pre-.bit: bad owner name (check-names)
db.namecoin.bit:2969: pre-.bit: bad owner name (check-names)
db.namecoin.bit:2970: www.pre-.bit: bad owner name (check-names)
db.namecoin.bit:4069: giga-.bit: bad owner name (check-names)
db.namecoin.bit:4070: giga-.bit: bad owner name (check-names)
db.namecoin.bit:4071: www.giga-.bit: bad owner name (check-names)
db.namecoin.bit:4574: post-.bit: bad owner name (check-names)
db.namecoin.bit:4575: post-.bit: bad owner name (check-names)
db.namecoin.bit:4576: www.post-.bit: bad owner name (check-names)
db.namecoin.bit:12818: the_seven.bit: bad owner name (check-names)
db.namecoin.bit:12819: *.the_seven.bit: bad owner name (check-names)
dns_master_load: db.namecoin.bit:13043: bittacular.bit: CNAME and other data
RegEx needs to be added to filter out invalid wildcard NS descriptors.
---Errors in Syslog---
Nov 26 08:37:14 dns1 named[21283]: dns_master_load: /var/lib/bind/dotbit/db.namecoin.bit:15678: *.suzukibonto.bit: invalid NS owner name (wildcard)
Nov 26 08:37:14 dns1 named[21283]: zone bit/IN: loading from master file /var/lib/bind/dotbit/db.namecoin.bit failed: invalid NS owner name (wildcard)
---Entry in File---
suzukibonto IN A 178.63.16.21
*.suzukibonto IN NS ns11.orangewebsite.com.
*.suzukibonto IN NS ns12.orangewebsite.com.
Inside name.class.php the regex:
$mask['ip'] = '@^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$@';
accepts ip addresses such as: 10.00.10.110 which causes bind to give an error.
This should be updated to a regex such as this:
^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$
There are currently in the blockchain some domains which are valid according to the DNS but not according to the stricter LDH rule of host names. BIND, by default, reject them and therefore cannot load .BIT :
Jan 18 17:29:17 ludwigVII named[23967]: /etc/bind/dotbit/db.namecoin.bit:15421: jdt_test.bit: bad owner name (check-names)
Jan 18 17:29:39 ludwigVII named[23967]: /etc/bind/dotbit/db.namecoin.bit:22629: andrey_vasilyev.bit: bad owner name (check-names)
It would be good if namescan.php checked these names and have the ability to filter them out.
Here is an example with ns records :
{"map":{"":{"ns":["ns0.web-sweet-web.net","ns1.web-sweet-web.net"]}}}
ns0.web-sweet-web.net & ns1.web-sweet-web.net are converted to the following ip addresses 178.32.102.200 & 188.165.40.50 and those ip addresses are used by bind.
Due to the caching system, if ns0.web-sweet-web.net & ns1.web-sweet-web.net change their ip, the change will be ignored.
Hi, and excuse me for my not so good English.
Today I made everything as shown in Readme installing my own dotbit DNS. One wrong domain found in NMC blockchain has CNAME record together with DNAME, while CNAME can't exist together with another records as Bind says. When this domain goes into Bind config it BREAKS entire .bit zone!
I wrote a little piece of code to handle this bug and ignore broken zones.
name.class.php
Find
foreach($records as $record=>$values) {
switch($record) {
case 'email':
#$this->bindZones[$fZone]['email'] = $values[0];
#$this->bindForwards[$fZone][] = str_pad($subdom, 15, ' ').$rec[$record].'"Email: '.$values[0].'"';
$other_exists = true;
break;
Insert before
$cname_exists = $other_exists = false;
foreach($records as $record=>$values) {
switch($record) {
case 'alias':
$cname_exists = true;
break;
case 'email':
case 'translate':
case 'ip':
case 'ip6':
case 'ns':
$other_exists = true;
}
}
if ($cname_exists && $other_exists)
{
continue;
}
After this fix everything's OK.
running named-checkzone bit db.namecoin.bit
get this kind of output:
dns_rdata_fromtext: db.namecoin.bit:15: near eol: bad hex encoding
dns_rdata_fromtext: db.namecoin.bit:16: near eol: bad hex encoding
zone bit/IN: loading from master file db.namecoin.bit failed: bad hex encoding
zone bit/IN: not loaded due to errors.
where row 15 and 16 is:
puggan IN DS 6924 7 1 0B9DFCD37D37EB6D41EB7085EF603DEF4F7DD44079135F03085F3D080E39
puggan IN DS 6924 7 2 D80DC4DFB077DB6045D82D38DC3EB9F36DC1EFA0FC0F6100DBBE7803D040102D3DF7A03CEBCEFB085DB9135F04D85D75
Also a issue reported in fork: puggan#1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.