#
# Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
use strict;
use warnings;
$pidf->close or die "cannot close pid file: $!";
my $localaddr = "10.53.0.3";
my $localport = 5300;
my $verbose = 0;
my $ttl = 60;
my $zone = "example.broken";
my $nsname = "ns3.$zone";
my $synth = "synth-then-dname.$zone";
my $synth2 = "synth2-then-dname.$zone";
sub reply_handler {
print ("request: $qname/$qtype\n");
if ($qname eq "example.broken") {
if ($qtype eq "SOA") {
} elsif ($qtype eq "NS") {
}
$rcode = "NOERROR";
} elsif ($qname eq "cname-to-$synth2") {
$rcode = "NOERROR";
if ($qtype eq "DNAME") {
}
$rcode = "NOERROR";
} elsif ($qname eq "name.$synth") {
$rcode = "NOERROR";
} elsif ($qname eq "name.$synth2") {
$rcode = "NOERROR";
} else {
$rcode = "REFUSED";
}
}
'port=i' => \$localport,
'verbose!' => \$verbose,
);
ReplyHandler => \&reply_handler,
);