Skip to content

Commit

Permalink
fixed AAAA responding issue according to rfc4074
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixlzx committed Feb 1, 2014
1 parent 330c014 commit a5a8117
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dnsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function randomOrder() {
}

function authorityNS(res, queryName, callback) {
var testv4 = new RegExp(/\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?/)
var testv4 = new RegExp(/\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?/);
// Send authority NS records.
config.nameservers.forEach(function(ns) {
res.authority.push(dns.NS({
Expand Down Expand Up @@ -415,6 +415,8 @@ function minimoedns(request, response) {
result = result.sort(randomOrder);
result.forEach(function(record) {
switch (record.type) {
case "A":
break;
case "AAAA":
response.answer.push(dns.AAAA({
name: record.name,
Expand Down
2 changes: 1 addition & 1 deletion record-mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ exports.queryAAAA = function(name, callback) {
if (err) {
console.log(err.message);
}
connection.query('SELECT * from `records` WHERE `paused` IS NOT TRUE AND `name` = ? AND (`type` = "AAAA" OR `type` = "CNAME")',
connection.query('SELECT * from `records` WHERE `paused` IS NOT TRUE AND `name` = ? AND (`type` = "A" OR `type` = "AAAA" OR `type` = "CNAME")',
name,
function(err, result) {
if (err) {
Expand Down

0 comments on commit a5a8117

Please sign in to comment.