Commit 9a1caf99 authored by Evan Hunt's avatar Evan Hunt

add geoip2 system test

parent 6399a70c
......@@ -63,7 +63,8 @@ PARALLEL_COMMON="dnssec rpzrecurse serve-stale \
dns64 dscp dsdigest dyndb \
ednscompliance emptyzones \
fetchlimit filter-aaaa formerr forward \
geoip glue idna inline integrity ixfr keepalive legacy limits \
geoip geoip2 glue idna inline integrity ixfr \
keepalive legacy limits \
masterfile masterformat metadata mirror mkeys \
names notify nslookup nsupdate nzd2nzf \
padding pending pipelined qmin \
......
#!/bin/sh
#
# Copyright (C) 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/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f ns2/named.conf
rm -f ns2/example*.db
rm -f dig.out.* rndc.out.*
rm -f ns?/named.run
rm -f ns?/named.memstats
rm -f ns*/named.lock
rm -f ns*/managed-keys.bind* ns*/*.mkeys*
/*
* Copyright (C) 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/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// NS2
controls { /* empty */ };
options {
query-source address 10.53.0.2;
notify-source 10.53.0.2;
transfer-source 10.53.0.2;
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
recursion no;
geoip-directory "data";
allow-query {
geoip area 831;
geoip areacode 831;
geoip metro 828;
geoip metrocode 828;
geoip tz "America/Los_Angeles";
geoip timezone "America/Los_Angeles";
geoip postal 95060;
geoip postalcode 95060;
};
};
/*
* Copyright (C) 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/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// NS2
options {
query-source address 10.53.0.2;
notify-source 10.53.0.2;
transfer-source 10.53.0.2;
pid-file "named.pid";
listen-on { 10.53.0.2; };
};
view one {
match-clients { geoip db unknown asnum "WX"; };
zone "example" {
type master;
file "example1.db";
};
};
/*
* Copyright (C) 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/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// NS2
controls { /* empty */ };
options {
query-source address 10.53.0.2;
notify-source 10.53.0.2;
transfer-source 10.53.0.2;
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
recursion no;
geoip-directory "data";
allow-query {
geoip netspeed 100;
geoip metro 828;
geoip metrocode 828;
geoip tz "America/Los_Angeles";
geoip timezone "America/Los_Angeles";
geoip postal 95060;
geoip postalcode 95060;
};
};
/*
* Copyright (C) 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/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// NS2
options {
query-source address 10.53.0.2;
notify-source 10.53.0.2;
transfer-source 10.53.0.2;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
recursion no;
dnssec-validation no;
geoip-directory "../data";
};
key rndc_key {
secret "1234abcd8765";
algorithm hmac-sha256;
};
controls {
inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
view one {
match-clients { geoip db region region "California"; };
zone "example" {
type master;
file "example1.db";
};
};
/*
* Copyright (C) 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/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// NS2
options {
query-source address 10.53.0.2;
notify-source 10.53.0.2;
transfer-source 10.53.0.2;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
recursion no;
dnssec-validation no;
geoip-directory "../data";
};
view one {
match-clients { geoip db country country AUS; };
zone "example" {
type master;
file "example1.db";
};
};
/*
* Copyright (C) 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/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// NS2
controls { /* empty */ };
options {
query-source address 10.53.0.2;
notify-source 10.53.0.2;
transfer-source 10.53.0.2;
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
recursion no;
geoip-directory "data";
allow-query {
geoip metro 828;
geoip metrocode 828;
geoip tz "America/Los_Angeles";
geoip timezone "America/Los_Angeles";
geoip postal 95060;
geoip postalcode 95060;
};
};
[
{
"::10.53.0.1/128" : {
"continent" : {
"code" : "NA",
"names" : {
"en" : "North America"
}
},
"country" : {
"iso_code" : "US",
"names" : {
"en" : "United States"
}
},
"city" : {
"names" : {
"en" : "Redwood City"
}
},
"location" : {
"metro_code" : "807",
"time_zone" : "America/Los_Angeles"
},
"postal" : {
"code" : "94063"
},
"subdivisions" : [
{
"iso_code" : "CA",
"names" : {
"en" : "California"
}
}
]
}
},
{
"::10.53.0.2/128" : {
"continent" : {
"code" : "NA",
"names" : {
"en" : "North America"
}
},
"country" : {
"iso_code" : "US",
"names" : {
"en" : "United States"
}
},
"city" : {
"names" : {
"en" : "Santa Cruz"
}
},
"location" : {
"metro_code" : "828",
"time_zone" : "America/Los_Angeles"
},
"postal" : {
"code" : "95060"
},
"subdivisions" : [
{
"iso_code" : "CA",
"names" : {
"en" : "California"
}
}
]
}
},
{
"::10.53.0.3/128" : {
"continent" : {
"code" : "NA",
"names" : {
"en" : "North America"
}
},
"country" : {
"iso_code" : "US",
"names" : {
"en" : "United States"
}
},
"city" : {
"names" : {
"en" : "Oklahoma City"
}
},
"location" : {
"metro_code" : "650",
"time_zone" : "America/Chicago"
},
"postal" : {
"code" : "73120"
},
"subdivisions" : [
{
"iso_code" : "OK",
"names" : {
"en" : "Oklahoma"
}
}
]
}
},
{
"::10.53.0.4/128" : {
"continent" : {
"code" : "NA",
"names" : {
"en" : "North America"
}
},
"country" : {
"iso_code" : "US",
"names" : {
"en" : "United States"
}
},
"city" : {
"names" : {
"en" : "Ashland"
}
},
"location" : {
"metro_code" : "556",
"time_zone" : "America/New_York"
},
"postal" : {
"code" : "23005"
},
"subdivisions" : [
{
"iso_code" : "VA",
"names" : {
"en" : "Virginia"
}
}
]
}
},
{
"::10.53.0.5/128" : {
"continent" : {
"code" : "NA",
"names" : {
"en" : "North America"
}
},
"country" : {
"iso_code" : "US",
"names" : {
"en" : "United States"
}
},
"city" : {
"names" : {
"en" : "Atlanta"
}
},
"location" : {
"metro_code" : "524",
"time_zone" : "America/New_York"
},
"postal" : {
"code" : "30345"
},
"subdivisions" : [
{
"iso_code" : "GA",
"names" : {
"en" : "Georgia"
}
}
]
}
},
{
"::10.53.0.6/128" : {
"continent" : {
"code" : "NA",
"names" : {
"en" : "North America"
}
},
"country" : {
"iso_code" : "US",
"names" : {
"en" : "United States"
}
},
"city" : {
"names" : {
"en" : "Morrison"
}
},
"location" : {
"metro_code" : "751",
"time_zone" : "America/Denver"
},
"postal" : {
"code" : "80465"
},
"subdivisions" : [
{
"iso_code" : "CO",
"names" : {
"en" : "Colorado"
}
}
]
}
},
{
"::10.53.0.7/128" : {
"continent" : {
"code" : "NA",
"names" : {
"en" : "North America"
}
},
"country" : {
"iso_code" : "US",
"names" : {
"en" : "United States"
}
},
"city" : {
"names" : {
"en" : "Ketchikan"
}
},
"location" : {
"metro_code" : "747",
"time_zone" : "America/Anchorage"
},
"postal" : {
"code" : "99901"
},
"subdivisions" : [
{
"iso_code" : "AK",
"names" : {
"en" : "Alaska"
}
}
]
}
},
{
"fd92:7065:b8e:ffff::1/128" : {
"continent" : {
"code" : "NA",
"names" : {
"en" : "North America"
}
},
"country" : {
"iso_code" : "US",
"names" : {
"en" : "United States"
}
},
"city" : {
"names" : {
"en" : "Redwood City"
}
},
"location" : {
"metro_code" : "807",
"time_zone" : "America/Los_Angeles"
},
"postal" : {
"code" : "94063"
},
"subdivisions" : [
{
"iso_code" : "CA",
"names" : {
"en" : "California"
}
}
]
}
},
{
"fd92:7065:b8e:ffff::2/128" : {
"continent" : {
"code" : "NA",
"names" : {
"en" : "North America"
}
},
"country" : {
"iso_code" : "US",
"names" : {
"en" : "United States"
}
},
"city" : {
"names" : {
"en" : "Santa Cruz"
}
},
"location" : {
"metro_code" : "828",
"time_zone" : "America/Los_Angeles"
},
"postal" : {
"code" : "95060"
},
"subdivisions" : [
{
"iso_code" : "CA",
"names" : {
"en" : "California"
}
}
]
}
},
{
"fd92:7065:b8e:ffff::3/128" : {
"continent" : {
"code" : "NA",
"names" : {
"en" : "North America"
}
},
"country" : {
"iso_code" : "US",
"names" : {
"en" : "United States"
}
},
"city" : {
"names" : {
"en" : "Oklahoma City"
}
},
"location" : {
"metro_code" : "650",
"time_zone" : "America/Chicago"
},
"postal" : {
"code" : "73120"
},
"subdivisions" : [
{
"iso_code" : "OK",
"names" : {
"en" : "Oklahoma"
}
}
]
}
},
{
"fd92:7065:b8e:ffff::4/128" : {
"continent" : {
"code" : "NA",
"names" : {
"en" : "North America"
}
},
"country" : {
"iso_code" : "US",
"names" : {