Skip to content

Commit

Permalink
fix: make DNS resolution case insensitive.
Browse files Browse the repository at this point in the history
  • Loading branch information
zicklag committed Nov 5, 2024
1 parent 9d94344 commit e197c72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/dns/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ const DNS_MASTER = env.DNS_SOA_MASTER;
const soaSplit = env.DNS_SOA_EMAIL.split('@');
const DNS_EMAIL = soaSplit[0].replace('.', '\\.') + '.' + soaSplit[1];
const DNS_NAMESERVERS = env.DNS_NAMESERVERS.split(',');
const ALLOWED_DOMAINS = env.DNS_ALLOWED_DOMAINS.split(',');
const ALLOWED_DOMAINS = env.DNS_ALLOWED_DOMAINS.toLowerCase().split(',');
const DNS_LOG_VERBOSE =
!!env.DNS_LOG_VERBOSE && env.DNS_LOG_VERBOSE != '0' && env.DNS_LOG_VERBOSE != 'false';
const matchesAllowedDomains = (name: string): boolean => {
const n = name.toLowerCase();
for (const domain of ALLOWED_DOMAINS) {
if (name == domain || name.endsWith(`.${domain}`)) return true;
if (n == domain || n.endsWith(`.${domain}`)) return true;
}

return false;
Expand Down

0 comments on commit e197c72

Please sign in to comment.