Skip to content

Commit

Permalink
dns/server: blacklist rfc2606 domains in the resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
turbomaze committed Jan 27, 2021
1 parent d304ff4 commit 8fb70df
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/dns/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ const TYPE_MAP = Buffer.from('000722000000000380', 'hex');
const RES_OPT = { inet6: false, tcp: true };
const CACHE_TTL = 30 * 60 * 1000;

// reference: https://tools.ietf.org/id/draft-chapin-rfc2606bis-00.html#registry
const rfc2606 = [
'corp',
'domain',
'example',
'home',
'host',
'invalid',
'lan',
'local',
'localdomain',
'localhost',
'test'
];
const blacklist = new Set([
'bit', // Namecoin
'eth', // ENS
Expand All @@ -59,7 +73,8 @@ const blacklist = new Set([
'i2p', // Invisible Internet Project
'onion', // Tor
'tor', // OnioNS
'zkey' // GNS
'zkey', // GNS
...rfc2606
]);

/**
Expand Down

0 comments on commit 8fb70df

Please sign in to comment.