Commit 52523e0b authored by Rob Riepel's avatar Rob Riepel
Browse files

Make query comparisons case blind.

parent 8867893f
......@@ -20,7 +20,7 @@ $poller_results = "/var/lib/poller/lb";
$next_poller_time = 0;
$poller_run_variance = 5; # variance in time to poll all load-balance systems
$default_ttl = 0;
$my_domain = "best.stanford.edu";
$my_domain = "best.stanford.edu"; # lowercase only!
$hostmaster = "action.stanford.edu";
@servers = qw(lbdns1.stanford.edu lbdns2.stanford.edu lbdns3.stanford.edu);
@SOA = ($servers[0], $hostmaster, time(), 3600, 1800, 86400, 0);
......@@ -91,7 +91,7 @@ while (<>) {
}
# domain SOA and NS queries
if ($qname eq $my_domain) {
if (lc($qname) eq $my_domain) {
if ($qtype eq "SOA" || $qtype eq "ANY") {
write_log("sending SOA record");
print "DATA $qname $qclass SOA 3600 -1 " . join("\t",@SOA) . "\n";
......@@ -103,9 +103,9 @@ while (<>) {
}
# dynamic queries
elsif ($qname =~ ".+\.$my_domain") {
elsif ($qname =~ /.+\.$my_domain$/i) {
write_log("sending dynamic response for $qname/$qtype");
print handle_lb_request(split(/\./,$qname,2),$qtype,$qclass);
print handle_lb_request(split(/\./,lc($qname),2),$qtype,$qclass);
}
print "END\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment