mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
NEW FEATURE: Support Split Horizon DNS (#1034)
* Implement main feature * BIND: Permit printf-like file name formats * BIND: Make filenameformat work forwards and backwards. * Fix extrator test cases
This commit is contained in:
24
pkg/js/parse_tests/037-splithor.js
Normal file
24
pkg/js/parse_tests/037-splithor.js
Normal file
@@ -0,0 +1,24 @@
|
||||
var REG = NewRegistrar("Third-Party", "NONE");
|
||||
var DNS_MAIN = NewDnsProvider("otherconfig", "CLOUDFLAREAPI");
|
||||
var DNS_INSIDE = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI");
|
||||
var DNS_OUTSIDE = NewDnsProvider("bind", "BIND");
|
||||
|
||||
D("example.com", REG, DnsProvider(DNS_MAIN),
|
||||
A("main", "3.3.3.3")
|
||||
);
|
||||
|
||||
D("example.com!inside", REG, DnsProvider(DNS_INSIDE),
|
||||
A("main", "1.1.1.1")
|
||||
);
|
||||
|
||||
D("example.com!outside", REG, DnsProvider(DNS_OUTSIDE),
|
||||
A("main", "8.8.8.8")
|
||||
);
|
||||
|
||||
D_EXTEND("example.com",
|
||||
A("www", "33.33.33.33")
|
||||
);
|
||||
|
||||
D_EXTEND("example.com!inside",
|
||||
A("main", "11.11.11.11")
|
||||
);
|
76
pkg/js/parse_tests/037-splithor.json
Normal file
76
pkg/js/parse_tests/037-splithor.json
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"dns_providers": [
|
||||
{
|
||||
"name": "otherconfig",
|
||||
"type": "CLOUDFLAREAPI"
|
||||
},
|
||||
{
|
||||
"name": "Cloudflare",
|
||||
"type": "CLOUDFLAREAPI"
|
||||
},
|
||||
{
|
||||
"name": "bind",
|
||||
"type": "BIND"
|
||||
}
|
||||
],
|
||||
"domains": [
|
||||
{
|
||||
"dnsProviders": {
|
||||
"otherconfig": -1
|
||||
},
|
||||
"name": "example.com",
|
||||
"records": [
|
||||
{
|
||||
"name": "main",
|
||||
"target": "3.3.3.3",
|
||||
"type": "A"
|
||||
},
|
||||
{
|
||||
"name": "www",
|
||||
"target": "33.33.33.33",
|
||||
"type": "A"
|
||||
}
|
||||
],
|
||||
"registrar": "Third-Party"
|
||||
},
|
||||
{
|
||||
"dnsProviders": {
|
||||
"Cloudflare": -1
|
||||
},
|
||||
"name": "example.com!inside",
|
||||
"records": [
|
||||
{
|
||||
"name": "main",
|
||||
"target": "1.1.1.1",
|
||||
"type": "A"
|
||||
},
|
||||
{
|
||||
"name": "main",
|
||||
"target": "11.11.11.11",
|
||||
"type": "A"
|
||||
}
|
||||
],
|
||||
"registrar": "Third-Party"
|
||||
},
|
||||
{
|
||||
"dnsProviders": {
|
||||
"bind": -1
|
||||
},
|
||||
"name": "example.com!outside",
|
||||
"records": [
|
||||
{
|
||||
"name": "main",
|
||||
"target": "8.8.8.8",
|
||||
"type": "A"
|
||||
}
|
||||
],
|
||||
"registrar": "Third-Party"
|
||||
}
|
||||
],
|
||||
"registrars": [
|
||||
{
|
||||
"name": "Third-Party",
|
||||
"type": "NONE"
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user