Commit graph

388 commits

Author SHA1 Message Date
Tom Limoncelli 61fc663c3d BUG: AutoDNSSEC validation is too aggressive
This should be a warning.
2023-03-17 11:36:44 -04:00
Paul Dee 3b6591fd95
NEW FEATURE: Support DNS LOC record type (#2174) 2023-03-16 14:04:20 -04:00
Tom Limoncelli 30646a15f7
CHORE: go generate (#2180) 2023-03-16 09:21:35 -04:00
Tom Limoncelli 81054e72c5
CHORE: linting (#2176) 2023-03-15 18:35:34 -04:00
Tom Limoncelli 2be3edc0a7
Report provider name even in skinny mode (--full=false) (#2163) 2023-03-14 13:45:32 -04:00
Tom Limoncelli dde7e5daf7
FEATURE: Detect simple CNAME loops (#2112) 2023-03-01 10:15:41 -05:00
Tom Limoncelli 2586e2b611
CORE: Clean up diff2 code in prep for production (#2104) 2023-02-28 01:25:09 -05:00
Tom Limoncelli e129e40313
FEATURE: Colorize diff2 output (#2103) 2023-02-28 01:14:06 -05:00
Tom Limoncelli 169d7c8062
CHORE: linting (#2098) 2023-02-27 20:28:17 -05:00
Tom Limoncelli 05dc26bf2e
BUG: diff2: ttl changes don't always work (#2093) 2023-02-25 22:40:54 -05:00
Jeffrey Cafferata ab872cc13f
CHORE: Go fmt (#2095)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2023-02-25 22:20:12 -05:00
Yannik Sembritzki b1b24df6cb
Remove value check for removed AUTODNSSEC() function (we now only have AUTODNSSEC_ON and AUTODNSSEC_OFF) (#2091) 2023-02-23 08:28:22 -05:00
Yannik Sembritzki 7236ea818e
Verify that registrar and dns providers match if autodnssec is enabled (#2056) (#2090)
Co-authored-by: Yannik Sembritzki <yannik@sembritzki.org>
2023-02-22 14:43:27 -05:00
Tom Limoncelli fc3a217dc1
Bugfixed: NO_PURGE now works on all diff2 providers (#2084) 2023-02-19 12:33:08 -05:00
Florian Ritterhoff fa67fcbc8b
NEW FEATURE: Colorize preview/push output (#2076) 2023-02-19 10:54:53 -05:00
Tom Limoncelli 17a43cb0a9
TTL warnings should be more verbose (#2069) 2023-02-15 10:00:02 -05:00
Tom Limoncelli e3dc604247
AZURE_DNS: Convert to use diff2 natively (#2058) 2023-02-07 16:53:49 -05:00
Yannik Sembritzki dc02d5b74f
Expect SOA mailbox in hostmaster@example.org format instead of hostmaster.example.org (#2037)
Co-authored-by: Yannik Sembritzki <yannik@sembritzki.org>
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2023-02-07 09:25:41 -05:00
Tom Limoncelli e1ce6ff34f
CLOUDFLARE: Adopt diff2 (#2040) 2023-02-01 16:18:01 -05:00
Tom Limoncelli de202531cb
NEW FEATURE: NO_PURGE reports what is not purged (diff2 only) (#2031) 2023-02-01 07:27:00 -05:00
Costas Drogos 7ed849d10d
NS1: Improve NS1_URLFWD handling (#2015) 2023-01-29 22:01:41 -05:00
Jeffrey Cafferata 430568c8f8
DOCS: Replace stackexchange.github.io (#2004)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2023-01-29 13:14:22 -05:00
Tom Limoncelli 0051b41720
BUGFIX: CREATE may product empty log messages (ByRecordSet) (#2013) 2023-01-29 13:01:40 -05:00
Tom Limoncelli a136621052
Improve warnings related to _ and TTLs (#1989) 2023-01-28 11:10:02 -05:00
Tom Limoncelli 8249a4b95b
Linting (#1996) 2023-01-28 11:09:38 -05:00
Jeffrey Cafferata f912b15adc
DOCS: Migrated documentation website to Gitbook (#1809) 2023-01-20 07:56:20 -05:00
Tom Limoncelli 9bb38c4526
CHORE: Remove references to TXTMulti (#1953) 2023-01-18 11:45:36 -05:00
Jed Fox 1e337abcdf
Provide TypeScript typings for dnsconfig.js (#1830)
Co-authored-by: Jeffrey Cafferata <jeffrey@jcid.nl>
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2023-01-12 16:59:42 -05:00
Tom Limoncelli 214eaeb84d
DOCS: Clarify ByRecord() assertions (#1931) 2023-01-11 12:17:34 -05:00
Tom Limoncelli 5c0801f4a8
DOCS: Improve pkg/diff2 documentation (#1903) 2023-01-01 14:14:18 -05:00
Tom Limoncelli 96e4e88fc5
Cleanups (#1871) 2022-12-30 22:03:36 -05:00
Tom Limoncelli 397ce107e5
REFACTOR: Add a backwards compatible interface to diff2 (#1870) 2022-12-30 21:53:50 -05:00
Tom Limoncelli d765ced927
CHORE: Make Test_filterBy more readable (#1869) 2022-12-30 21:33:14 -05:00
Tom Limoncelli bf0badf2f2
BUG: SPF split doesn't produce consistent output (#1865) 2022-12-26 09:11:52 -05:00
Tom Limoncelli 54fc2e9ce3
NEW FEATURE: diff2: A better "diff" mechanism (#1852) 2022-12-11 17:28:58 -05:00
Tom Limoncelli b0f2945510
REFACTOR: Add diff2 enable flag to all DNS providers (#1851)
This should enable the diff2 code to be inserted with good "git blame" results for new code.  I'm adding this early to catch any problems early.
2022-12-11 15:02:58 -05:00
Tom Limoncelli fe03b29ab2
format helpers.js (#1848) 2022-12-07 17:14:51 -05:00
Tom Limoncelli ec5c4abbd6
BUGFIX: PrettySort helper doesn't sort (#1838)
PrettySort doesn't call sort! Luckily the only code that calls this is the "get-zones" subcommand, and nobody noticed that the output isn't sorted.

By making this change, people using "get-zones" to make their initial dnsconfig.js file will now find that their draft D() code is a little prettier.
2022-12-02 08:33:24 -05:00
Dragos Harabor 68516025a5
FEATURE: Add rTypes restrictions to IGNORE_NAME (#1808)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-11-07 11:27:04 -05:00
Tom Limoncelli 61e500b7dc
DEV: Optimize integration tests (#1742) 2022-09-07 14:08:06 -04:00
Tom Limoncelli 8bb63be8f5
Add --verbose flag, default to less verbose output (#1721) 2022-08-20 20:59:02 -04:00
Tom Limoncelli 1010138fb6 gofmt -s -w 2022-08-14 20:49:57 -04:00
Tom Limoncelli ccb582b278
CHORE: Linting (#1704)
* Remove deprecated io/ioutil
* fixup!
* staticcheck and linting
* revert models/provider.go
* Fix imports to new style
* linting
2022-08-14 20:46:56 -04:00
Tom Limoncelli cd61c2c766
CHORE: Remove deprecated io/ioutil (#1699)
* Remove deprecated io/ioutil

* fixup!

* fixup!
2022-08-14 12:50:15 -04:00
Tom Limoncelli 31723ad146
PERFORMANCE: Refactor auditrecords.go to loop only once #1570 (#1658)
* stash

* Use rejectif idea

* rename

* wip!

* Convert old systems to new

* fixup!

* fix typo
2022-08-11 17:24:47 -04:00
Tom Limoncelli 443b99aa59
CHORE: Remove duplicate ToDiff code (#1684) 2022-08-11 16:13:24 -04:00
Tom Limoncelli 0a6fa677f3
Fix broken test (#1659) 2022-08-08 10:30:21 -04:00
MisterErwin 7865e37c8f
Add RWTH provider (#1629)
* Add RWTH provider

* fix Owners order

* Reorganize RWTH Provider

* Fix staticcheck and code style issues

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-08-04 14:40:27 -04:00
Jakob Ackermann a00572af4a
Create zone before use (#1642)
* preview/push: ensure zones exists before querying them

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: reset zone cache when creating a new zone

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* ROUTE53: reset zone cache when creating a new zone

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-08-01 14:44:17 -04:00
Amelia Aronsohn befb52be86
DNSIMPLE: Fix TXT Handling, Second Edition (#1624)
* Fix typo and add sandbox information

* Use SetTargetTXT in GetZoneRecords

This fixes the behavior documented in #1622

Also apply cleanup to GetZoneRecords

* Remove SetTargetTXT, does not work in all tests

* Set The most correct TXT handling

* Well, There's your problem

* Add an audit and test for unpaired quotes

* Add some commentary

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-07-22 09:36:28 -04:00
Tom Limoncelli bcaa6b15cb
AuditRecords should report the provider name (#1628) 2022-07-18 12:59:22 -04:00
Tom Limoncelli 959f721c04
MAINT: Update TXT docs, suggest not using TxtNoLen255 (#1548)
* suggest not using TxtNoLen255

* Rename functions

* wip!

* fixing!
2022-06-20 11:34:05 -04:00
Jan-Philipp Benecke bcb968411a
MAINT: Unify provider outputs to pkg/printer (#1546)
* Unify provider outputs to pkg/printer

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* No need for custom Errorf

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* Add missing import for activedir

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* Add missing fmt import for activedir

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
2022-06-18 09:01:02 -04:00
Jan-Philipp Benecke ba2c7f9c0e
MAINT: Enforcing formatted code (#1544)
* Enforcing formatted code

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* Show lines

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* Run check after deps are installed

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
2022-06-18 08:56:04 -04:00
Tom Limoncelli 752e25471d
NEW PROVIDER: CSCGLOBAL as DNS Service Provider (#1516)
* Move the registrar features to a separate file

* Prepare the testing framework

* Roughed out functions

* Fix up structs

* WIP!

* First tests pass

* wip!

* Flesh out remaining rTypes, get nameservers, etc

* Fix TXT records

* Clean up code

* More cleanups. Fix CAA/SRV

* Linting

* Cleanups/linting

* Fix CAA [more] and more cleanups

* CSC does not like very long txt records

* Use timer only when interactive

* Disable CAA for now

* Update docs

* Remove debug printf

* add go-isatty

* cleanups
2022-06-12 16:01:08 -04:00
Jan-Philipp Benecke cfa104858d
FEATURE: --creds can refer to a command line to execute in addition to a file or script (#1521)
* Allow commands for creds file & refactoring

* Minor fix

* Add shell command ability to docs

Signed-off-by: Jan-Philipp Benecke <jan-philipp.benecke@jpbe.de>

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-06-06 14:37:45 -04:00
Tom Limoncelli 58b2704fde
BUG: With TYPE in creds.json, CAA compatibility check breaks (#1514) 2022-05-29 12:14:17 -04:00
Tom Limoncelli 997e1a0901
BUGFIX: Skip AuditRecords when running dnscontrol check (#1508)
Fixes 1507
2022-05-23 13:27:53 -04:00
Tom Limoncelli 9e6d642e35
NEW FEATURE: Moving provider TYPE from dnsconfig.js to creds.json (#1500)
Fixes https://github.com/StackExchange/dnscontrol/issues/1457

* New-style creds.json implememented backwards compatible

* Update tests

* Update docs

* Assume new-style TYPE
2022-05-08 14:23:45 -04:00
Costas Drogos 6e802f2257 Emit warning in case of label having multiple TTLs
An RRSet (=label) consisting of multiple records with different TTLs is
something not supported by most providers, and should be avoided.
Furthermore it is deprecated in rfc2181#section-5.2

Emit a warning for now during validation, eventually turning it into a full-blown error.

Fixes #1372
2022-05-04 11:20:27 -04:00
Costas Drogos c8a5060dfb
Emit warning in case of label having multiple TTLs (#1489)
* Emit warning in case of label having multiple TTLs

An RRSet (=label) consisting of multiple records with different TTLs is
something not supported by most providers, and should be avoided.
Furthermore it is deprecated in rfc2181#section-5.2

Emit a warning for now during validation, eventually turning it into a full-blown error.

Fixes #1372

* normalize: less verbose checkLabelHasMultipleTTLs

Code would previously emit a warning for each record it found matching a
previously found label but with a different ttl. This could potentially become
too verbose of an output for larger zones.

Split the loop into two loops, one storing labels and their records' TTLs, the
second checking for multiple TTLs, in order to minimize the messages logged to
one message per problematic label, regardless for the number of records involved.

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-05-04 08:41:16 -04:00
Costas Drogos 156ec01ea0
TESTING: pkg/js/parse_tests: fix a broken test (#1498)
012_duration creates multiple records under the same label, with different TTLs
We plan to deprecate this going forward, in #1372.

Modify the test in a way that creates one label per record, each having a
different TTL format as before, to be validated.
2022-05-03 19:46:48 -04:00
Tom Limoncelli 19550aeed9
Refactor: Rename providers/config to pkg/credsfile (#1494) 2022-05-02 20:12:30 -04:00
Tom Limoncelli 99210c9d1c
Make skip_fqdn_check error message easier to understand and fix (#1477) 2022-04-04 14:05:49 -04:00
Tom Limoncelli 91592ce4a7
MAINT: "DUPLICATE E_RECORD" no longer a hard error (#1465) 2022-03-25 12:09:24 -04:00
Tom Limoncelli 444b893e1b
MAINT: Sort various lists (#1433)
* maint: sort lists in build/generate/featureMatrix.go

* maint: sort lists in docs/byo-secrets.md

* maint: sort lists in models/record.go

* maint: sort lists in pkg/normalize/validate.go

* maint: sort lists in providers/activedir/activedirProvider.go

* maint: sort lists in providers/akamaiedgedns/akamaiEdgeDnsProvider.go

* maint: sort lists in providers/axfrddns/axfrddnsProvider.go

* maint: sort lists in providers/azuredns/azureDnsProvider.go

* maint: sort lists in providers/cloudflare/cloudflareProvider.go

* maint: sort lists in providers/cloudns/cloudnsProvider.go

* maint: sort lists in providers/desec/desecProvider.go

* maint: sort lists in providers/digitalocean/digitaloceanProvider.go

* maint: sort lists in providers/dnsimple/dnsimpleProvider.go

* maint: sort lists in providers/dnsmadeeasy/dnsMadeEasyProvider.go

* maint: sort lists in providers/exoscale/exoscaleProvider.go

* maint: sort lists in providers/gandiv5/gandi_v5Provider.go

* maint: sort lists in providers/hedns/hednsProvider.go

* maint: sort lists in providers/hetzner/hetznerProvider.go

* maint: sort lists in providers/hexonet/hexonetProvider.go

* maint: sort lists in providers/inwx/inwxProvider.go

* maint: sort lists in providers/linode/linodeProvider.go

* maint: sort lists in providers/namecheap/namecheapProvider.go

* maint: sort lists in providers/namedotcom/namedotcomProvider.go

* maint: sort lists in providers/netcup/netcupProvider.go

* maint: sort lists in providers/ns1/ns1Provider.go

* maint: sort lists in providers/octodns/octodnsProvider.go

* maint: sort lists in providers/oracle/oracleProvider.go

* maint: sort lists in providers/ovh/ovhProvider.go

* maint: sort lists in providers/packetframe/packetframeProvider.go

* maint: sort lists in providers/powerdns/powerdnsProvider.go

* maint: sort lists in providers/route53/route53Provider.go

* maint: sort lists in providers/vultr/vultrProvider.go

* Update go:build pragmas for windows

* More sorting

* go generate
2022-03-02 11:19:15 -05:00
tpdn fc75f89271
ClouDNS: Add CLOUDNS_WR (Web Redirects) (#1421)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-03-02 09:21:51 -05:00
Tom Limoncelli 886dbf6d00
MAINT: Make staticcheck more strict and fix new warnings (#1408)
* Make staticcheck more strict and fix new warnings
2022-02-11 14:30:45 -05:00
Tom Limoncelli f9c4887d95 Revert "Make staticcheck more strict and fix new warnings"
This reverts commit 5c456e2513.
2022-02-11 12:14:24 -05:00
Tom Limoncelli a70354775e Make staticcheck more strict and fix new warnings 2022-02-11 12:14:22 -05:00
Tom Limoncelli dcb0e58b99
MAINT: Linting (#1380)
* MAINT: Linting

* Unsort for a smaller diff

* fix hexonet error checking
2022-01-27 15:58:56 -05:00
Tom Limoncelli 360a6266c5 Revert "CLEANUP: Fix many golint/staticcheck issues"
This reverts commit de64f90c51.
2022-01-25 10:35:21 -05:00
Tom Limoncelli de64f90c51 CLEANUP: Fix many golint/staticcheck issues 2022-01-25 10:33:48 -05:00
Hampton 998a25aa08
BUG: Support RFC2317 by allowing slash in CNAME target (#1360)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2022-01-03 10:24:33 -05:00
Tom Limoncelli 7ae27aa0b9 Security: Fix many staticcheck warnings 2021-12-14 09:47:32 -05:00
norman-zon 58a5a4bcf0
Remove length checking from TxtNoMultipleStrings (#1308)
All functions in should test for only one condition. There already is a
function that tests for long TXT records: TxtNoLongStrings.
Add calls to TxtNoLongStrings in all providers that use
TxtNoMultipleStrings, to keep functionality, except for NS1 and ClouDNS,
which allow for any TXT record length, but not for multiple strings per
TXT.
2021-11-23 14:35:01 -05:00
Julius Rickert 6d48725e52
Add test cases for IDN domains (#1302)
Recreated IR json file
2021-11-03 10:45:01 -04:00
F.D.Castel 0d12eb7dc6
CLOUDFLAREAPI: Adds CF_WORKER_ROUTE (#1243)
* CLOUDFLAREAPI: Adds CF_WORKER_ROUTE.

- CLOUDFLAREAPI: Initial support for CF_WORKER_ROUTE.
- Put CF_WORKER_ROUTE behind a per-domain feature-flag.
- Adds Integration Test.
- Create Cloudflare workers for tests.
- Updates documentation.

* Workaround for updateWorkerRoute causing stack overflow.

* Sets AccountID.

* Updates to latest master (Thanks @tresni!).

* Removes $CLOUDFLAREAPI_ACCOUNTNAME.

* Add alltrue() filter and -cfworkers flag

* Final workers changes

* alltrue() should be implemented like other filters.
* Update documentation.

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2021-10-11 16:04:49 -04:00
Vincent Hagen 8c5db2e11c
Add R53_ZONE as an domain identifier (#1241)
Using R53_ZONE allows you to differentiate between split horizon
domains across zones.
2021-09-02 16:54:54 -04:00
Tom Limoncelli 3fa5712232
NEW MACROS: DOMAIN_ELSEWHERE and DOMAIN_ELSEWHERE_AUTO (#1237)
* NEW MACROS: DOMAIN_ELSEWHERE and DOMAIN_ELSEWHERE_AUTO
* Finish docs
2021-09-02 15:41:22 -04:00
Patrik Kernstock 9316517291
DMARC_BUILDER: specify version, use values when specified (#1236)
* Allow version, use values when specified

* Updated DMARC_BUILDER docs
2021-08-14 14:43:39 -04:00
Vincent Hagen 6fc3534aa3
Add INCLUDE statement to include records from other domains (#1219) 2021-07-25 12:03:58 -04:00
Vincent Hagen 243762d171
SPF Flatten for non apex domains (#1220) 2021-07-25 11:53:31 -04:00
nemunaire 80f22df705
MAINTENANCE: Return error instead of panic when converting RR to RC (#1199) 2021-07-06 11:03:29 -04:00
Tom Limoncelli 0630c185cf
Release v3.10.1 (#1194)
* Release v3.10.1

* Update dependencies

* RELENG: Update doc to verify version string

* Fix codeql issue
2021-07-01 10:17:43 -04:00
Tom Limoncelli 4b68e14039
Fix codeql errors (#1181) 2021-07-01 09:30:02 -04:00
Tom Limoncelli 654736be29
Improve MSDNS naptr support (#1165)
* MSDNS: Improve reliability of zone dump

* Update tests

* MSDNS: Add initial NAPTR support

* Update

* fix tests

* fix tests

* Fixing integration tests for NAPTR

* Handle bad JSON. Handle NAPTR TTLs
2021-06-24 18:26:21 -04:00
Tom Limoncelli 6d64fc8cac
Fix CodeQL issues (#1173) 2021-06-24 18:15:09 -04:00
Steven Vernick be1f03fb75
NEW PROVIDER: AkamaiEdgeDNS (#1174)
* downcase TLSA

* Akamai provider

* Akamai provider

* EdgeDNS provider

* AkamaiEdgeDNS provider

* AkamaiEdgeDNS provider

* AkamaiEdgeDNS provider

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2021-06-22 10:24:49 -04:00
Tom Limoncelli 1cea854e1c
MAINT: Adopt go 1.16's embed feature (#1162)
* MAINT: Switch from esc to embed
* Simplify
* Update minimum go version in docs and pipelines
* go generate
2021-06-04 15:50:47 -04:00
Tom Limoncelli 1ec61c536b
Release v3.9.0 (#1156)
* Release v3.9.0

* go generate
2021-05-13 12:48:05 -04:00
Jan-Philipp Benecke cf8e288339
PowerDNS: fix order problems of delete corrections & some cleanup (#1153)
Signed-off-by: Jan-Philipp Benecke <jan-philipp.benecke@jpbe.de>
2021-05-10 10:18:40 -04:00
Tom Limoncelli 24083d3f76
Add integration test for SOA (#1147)
* Add integration test for SOA

* Add docs for SOA record

* MAINT: Rename SoaInfo to SoaDefaults.

gorename -v -from '"github.com/StackExchange/dnscontrol/v3/providers/bind".SoaInfo' -to SoaDefaults
2021-05-07 14:39:26 -04:00
fuero 4586ad1281
Direct SOA record management (#1115)
* Adds SOA record to JS, zone parsing and record validation

* adds JS parsing test for SOA record

* fix validation & regenerates static resources

* Adds label and target test for SOA record

* Removes serial from SOA JS macro

* Adds generated resources

* reformat with gofmt

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2021-05-04 15:47:26 -04:00
Tom Limoncelli 4ab4d4c9ed
IGNORE_NAME: Should work at domain apex (#1118)
* IGNORE_NAME: Add test at apex
* Fix IGNORE_NAME at apex
* Add comments and documentation
* Add a flag to disable IGNORE_NAME safety checks
2021-04-13 08:59:47 -04:00
Julius Rickert 836ae8854d
NEW MACRO: DMARC_BUILDER (#1047) 2021-03-08 08:50:14 -05:00
Tom Limoncelli 9f0ac5dfba
DKIM is a no-op now (#1084) 2021-03-07 15:01:03 -05:00
Tom Limoncelli 50a24605e6
Fix TXT docs, remove AUTOSPLIT (#1083) 2021-03-07 14:34:00 -05:00
Tom Limoncelli 8dea9edc34
Re-engineer TXT records for simplicity and better compliance (#1063)
TXT records are now handled different.

1. The raw input from dnsconfig.js is passed all the way to the provider. The provider can determine if it can or can't handle such records (auditrecords.go) and processes them internally as such.
2. The CanUseTXTMulti capability is no longer needed.

* DSPs now register a table of functions
* Use audits for txt record variations
* unit tests pass. integration fails.
* fix deepcopy problem
* rename to AuditRecordSupport
* Reduce use of TXTMulti
* Remove CanUseTXTMulti
* fix Test Skip
* fix DO
* fix vultr
* fix NDC
* msdns fixes
* Fix powerdns and cloudflare
* HEDNS: Fix usage of target field to resolve TXT handling (#1067)
* Fix HEXONET

Co-authored-by: Robert Blenkinsopp <robert@blenkinsopp.net>
Co-authored-by: Jakob Ackermann <das7pad@outlook.com>
2021-03-07 13:19:22 -05:00
Tom Limoncelli 21e85e6528
"Target" RecordConfig should not be exported (#1061)
* Unexport RecordConfig.Target
* Fix tests
* HEDNS: Fix usage of target field to resolve TXT handling (#1067)

Co-authored-by: Robert Blenkinsopp <robert@blenkinsopp.net>
2021-03-04 18:58:23 -05:00
Tom Limoncelli 95c48ca220 Fix broken test 2021-03-01 20:48:29 -05:00
Tom Limoncelli 975055fb20
BUG: D_EXTEND should not apply DEFAULTS{} (#1055)
* BUG: D_EXTEND should not apply DEFAULTS{}

Fixes https://github.com/StackExchange/dnscontrol/issues/1042

* go generate
2021-03-01 10:53:29 -05:00
Jan-Philipp Benecke 06a1cc3d38
POWERDNS: Some minor fixes for ALIAS and TXTMulti and integration testing (#1065)
* POWERDNS: Some minor fixes for ALIAS and integration testing
* POWERDNS: Readd missing error handling
2021-03-01 07:09:49 -05:00
Tom Limoncelli a2042c2eda
NS1: Support NS1_URLFWD (#1046) 2021-02-10 11:57:15 -05:00
Tom Limoncelli c547beacc0
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
2021-02-05 12:12:45 -05:00
Tom Limoncelli 36289f7157
BUG: Labels that are FQDN can cause panics (#1040) 2021-02-05 11:58:17 -05:00
Tom Limoncelli eaa382e58d js_test.go should leave behind actuals 2021-02-01 07:33:41 -05:00
Armand Grillet 0d9cc35deb
Add SPF support for RecordConfig (#1020)
This type is identical to TXT but used for other purposes, it is
officially supported by OctoDNS.

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2021-01-24 15:36:48 -05:00
Yuhui Xu 6efedd689d
New feature: FETCH() permits http gets in dnsconfig.js (#1007)
add PANIC() and error-handled FETCH()
2021-01-06 10:45:32 -05:00
Tom Limoncelli 18d99fd30f
Add .gitattributes file and fix line endings to match. (#1004)
* NEW: .gitattributes
* Fix line endings
* Fix File Endings
2020-12-25 10:18:01 -05:00
Tom Limoncelli 063d550816
js_test.go should generate & test zonefile output too (#986)
* js_test.go: Do a zonefile test if $TESTNAME/parse_tests/{zonefile} exists.
* Add parse_tests zone files for all the tests that make sense.
* js_test.go: Addd the test datafile when displaying failures.
* 007-importTransformTTL.js: Was referring to a non-existent domain.
* 012-duration.js: Had duplicate DNS records.
* 029-dextendsub.js: Move CF-related tests to separate test.
* validate.go: Report non-existent domains as an error.
* cloudflareProvider.go: newCloudflare should not talk to the API.
2020-12-03 09:33:39 -05:00
Tom Limoncelli 6443a31ca8
Fix REV and PTR (#979)
* Fix REV and PTR
2020-12-03 08:33:37 -05:00
Tom Limoncelli 2e7311078c
MAINT: Fix parse_test numbering (#985) 2020-12-01 11:22:12 -05:00
Tom Limoncelli d6b191bae4
CLOUDFLARE: get-zones now outputs "orange cloud" status (#952)
* CLOUDFLARE: get-zones now outputs "orange cloud" status
2020-11-24 10:30:21 -05:00
Tom Limoncelli 13a1360779
TXT records should check length at check/preview time (#947)
* TXT records should check length
* Add validation to TXT generator
* Split and validate long TXT targets
* Add a metaparameter to TXT records to indicate autosplit is requested.
* SPF_BUILDER marks TXT records as needing to be autosplit.
* Validate should check for overly-long TXT targets
2020-11-18 07:05:26 -05:00
Tom Limoncelli 80c81b990a TESTING: Fix broken test 2020-10-30 12:04:41 -04:00
Jan-Philipp Benecke 512aa7d4b3
NEW FEATURE: Set JS variables from command line (#913)
* Add ability to specify variables that are passed to js

* Use SplitN to respect a = in value part

* Add JSON parsing for cli variables

* Remove JSON parsing for cli variables

* Add a function to set CLI defaults

* Update static.go
2020-10-27 10:43:00 -04:00
Patrik Kernstock 29c7ff3a05
Fix #910 (#912)
@patschi Thanks you for the speedy fix!  (and thank you for knowing Javascript!)
2020-10-25 13:29:25 -04:00
Tom Limoncelli 3a2b1b2f7b
Internal: deps updates and linting (#905)
* Update dependencies
* writing-providers.md: Update for Go Mod, etc.
* Linting pkg/version
* s/CloudflareAPI/api/g
* s/ApiKey/APIKey/g
* s/ApiToken/APIToken/g
* s/ApiUser/APIUser/g
2020-10-18 14:04:50 -04:00
Tom Limoncelli c899706309 Fix version 2020-10-12 12:55:10 -04:00
Tom Limoncelli a07a8cc731 Release v3.4.0 2020-10-12 12:13:07 -04:00
Tom Limoncelli 7acf8427f1 go generate 2020-10-12 11:54:18 -04:00
Tom Limoncelli da1cbad4ec
HEXONET: Implement get-zones, fix module problem (#898)
* VULTR: Update govultr to v1.0.0 (fixes #892) (#897)

* go get -u github.com/hexonet/go-sdk

* Fix HEXONET providers.json entry

* providers.json: json commma

* providers.json: fmtjson

* HEXONET: Implement get-zones. Fix tests and docs.

* fixup!

* Update azure test failures

* Move version info into its own package

* Use new version system
2020-10-12 11:45:44 -04:00
Tom Limoncelli 8205a8a356 Fix JSON comma 2020-10-07 16:04:13 -04:00
Tom Limoncelli dba20387bf
Fix D_EXTEND matching bug (#888)
* Use a standard JSON comparison tool

* Fixes https://github.com/StackExchange/dnscontrol/issues/886

* Delete file in wrong place.

* Remove the need for minify
2020-10-07 16:03:36 -04:00
Tom Limoncelli b275286dae
Add D_EXTEND (#885) (thanks to @ad8-bdl!)
* fix get-zones code block indentation

* extend D_EXTEND to handle subdomains

* fix targets: make absolute incl. subdomain where necessary

* clarify subdomain target test (not IP && not fqdn)

* Add parse_tests for D and D_EXTEND

* _getDomainObject: examine all domains

* human readable form

* consistent test IP addresses

* Improve docs and formatting

* propagate subdomain to canonicalisation

* en-US spelling

* rm extraneous console.log

* ignore subdomain for CF_REDIRECT

* clarify D_EXTEND doc re. CF_REDIRECT

* rm extraneous linebreak

* _getDomainObject: examine all domains

* human readable form

* consistent test IP addresses

* propagate subdomain to canonicalisation

* en-US spelling

* rm extraneous console.log

* ignore subdomain for CF_REDIRECT

* clarify D_EXTEND doc re. CF_REDIRECT

* rm extraneous linebreak

* GANDI_V5: Use github.com/go-gandi/go-gandi, not github.com/tiramiseb/go-gandi (#883)

* DOCUMENTATION: Fix error in CNAME.md (#877)

The current example `CNAME("def", "test.subdomain"), // def.example.com -> test.subdomain.example.com` is invalid (correctly raises a validation error, "ERROR: in CNAME def.example.com: target (test.subdomain) must end with a (.)")

* typos, fmt; example syntax fixes and real output

* formatting; re-add lost comment

* RecordConfig subdomain should be nullable

* providers/cscglobal/api.go: Fix fmt string

* More tests and docs

* go generate

Co-authored-by: Ben L <47653825+ad8-bdl@users.noreply.github.com>
2020-10-07 14:27:33 -04:00
Tom Limoncelli f082ad36c8
AUTODNSSEC -> AUTODNSSEC_ON (#863)
* AUTODNSSEC -> AUTODNSSEC_ON
* Validate AutoDNSSEC values
* AUTODNSSEC now generates a warning and does nothing.
2020-09-27 16:37:42 -04:00
Patrik Kernstock d56ffd3698 Display file where error occurred 2020-09-21 09:39:45 -04:00
Tom Limoncelli 74ea58f514 Better error messages 2020-09-21 09:39:45 -04:00
Tom Limoncelli 408e7eb0ce
NAMESERVER() validity check fixed (#866) 2020-09-20 10:41:42 -04:00
Tom Limoncelli 4432d38252
go get -u github.com/miekg/dns v1.1.31 (#846) 2020-09-04 16:26:56 -04:00
Mike Cochrane 66ec6dfa0f
MSTeams Notifier: Fix init bug in teamsNotifier (#845) 2020-09-04 11:50:58 -04:00
Mike Cochrane ff6aee9da4
Remove debug line left from development (#835) (#839) 2020-08-31 07:17:38 -04:00
Tom Limoncelli b6fd4dffd7
Cleanups: Fix many issues reported by staticcheck.io (#837)
* Lint: Fix ST1005: error strings should not be capitalized

* Cleanup: Fix a lot of staticcheck.io warnings
2020-08-30 20:38:08 -04:00
Tom Misilo cb9a82717b
Allow for Name's that start with _ (#830)
* Allow for Name's that start with _

* update tests

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-08-30 20:35:07 -04:00
Tom Limoncelli de308c0952
Lint: Fix ST1005: error strings should not be capitalized (#834) 2020-08-30 19:52:37 -04:00
Tom Limoncelli d6dd13820f
gofmt (#826) 2020-08-26 13:45:02 -04:00
Mike Cochrane 59747a96f0
Cleanup: Bubble errors up from diff instead of panic (#799) (#817) 2020-08-20 15:49:00 -04:00
Patrik Kernstock 576c2bd582
New feature: require_glob() (similar to require() but supports globs) (#804)
* Initial implementation of findFiles/globe/glob

* Fixed path, some small improvements

* filepath.Dir() calls Clean() automatically anyway

* Relative path support (like require()), renamed func

* Check file ext prefix, further comments, var renaming

* Updated static.go after merge

* Added doc for glob()

* Tiny adjustment of description of glob()

* Updated docs for possible pattern

* Reworked glob, added public-facing require_glob()

* Updated docs with examples

* Updated static.go

* go generate
2020-08-19 14:00:40 -04:00
Mike Cochrane 960dc66bd2
New feature: IGNORE_TARGET. Rename INGORE to IGNORE_NAME (#806) 2020-08-18 11:14:34 -04:00
Mike Cochrane 889ed75668
Notifications: Add support for Microsoft Teams (#812) 2020-08-14 12:23:54 -04:00
Patrik Kernstock d2d210a5af
New features: DU() and getConfiguredDomains() to assist modifying domains (#800)
* Added DU() and getConfiguredDomains()

* Added docs for both new functions

* Added a space between option and its value

* Renamed "DU" to "D_EXTEND", adjusted docs

* Fixed: Changed old DU() calls to D_EXTEND()
2020-08-04 09:43:02 -04:00
Michael Russell f21c8fc400
SPF Optimizer: Enable the use of TXTMulti records to support longer SPF records (#794)
* Add multiple string support to SPF optimizer

Notes:

* This implements [RFC 4408][rfc] for the SPF optimizer. Allowing for
more SPF records to fit within the 10 lookups by using multiple strings.
* By default the max size of the TXT remains at 255. Meaning users will
still only get a single 255 length string unless they modify `txtMaxSize`
and opt into this feature.
* The general recommendation when using multiple strings for TXT records
is to keep the size within a single UDP packet. It seems like the
maximum size for this depends on a bunch of factors that are sometimes
outside of your control. A similar tool has a [formula for estimating the
maximum allowed size][formula]. However I felt giving a user
configurable size would fit with the current configuration style that
dnscontrol has. Similar to how dnscontrol recommends only flattening a
record if absolutely needed, I can see this length being increased by
only enough to get you within 10 lookups.

[rfc]: https://tools.ietf.org/html/rfc4408#section-3.1.3
[formula]: https://github.com/oasys/mkspf/blob/master/Overhead.md

* Add a nice comment for the Chunks function
2020-07-31 13:28:13 -04:00
Michael Russell 237c573c2a
Make it possible to disable the raw SPF optimizer debug record (#795)
Open to other configuration opens for how best to make this optional. Or
potentially making this an opt in configuration item which would be a
breaking change.

The main reason that someone would want to disable this is if their raw
SPF record goes over the 255 characters. This is potentially another
place that could get some multi string support. But as it is only used
for debugging purposes it seems like there should be a way to outright
disable it too.
2020-07-31 10:40:22 -04:00
Tom Limoncelli 530bf10bfa
NEW: spf flattener can make first record extra short (#781)
* NEW: spf flattener can make first record extra short

* fixup!
2020-07-09 12:52:49 -04:00
Tom Limoncelli 541bb805da
linting (#777) 2020-07-06 20:18:24 -04:00
Tom Limoncelli 367a14ab44
Sort updates (cosmetic) (#772)
* Sort updates (cosmetic)

* comments

* More comments
2020-07-01 05:55:20 -04:00
Matthew Huxtable ff8ce26cee
Provider support for DS records as children only (#765)
This functionality is required by the GCLOUD provider, which supports
recordsets of type DS but only for child records of the zone, to enable
further delegation. It does not support them at the apex of the zone (@)
because Google Cloud DNS is not itself a registrar which needs to model
this information.

A related change (14ff68b151, #760) was
previously introduced to enable DS support in Google, which broke
integration tests with this provider.

To cleanly support this, we introduce a new provider capability
CanUseDSForChildren and appropriate integration tests. Further, it is no
longer possible to verify a provider has the proper capabilities for a
zone simply by existence of particular records; we adapt the capability
checks to enable inspection of the individual recordsets where this is
required.

Closes #762
2020-06-18 17:24:13 -04:00
Tom Limoncelli 676d98fc4a
Linting (#767)
What could possibly go wrong?
2020-06-18 09:37:57 -04:00
Tom Limoncelli 97d91cda4c
Implement a simple lexagraphic sort. (#755) 2020-05-30 12:03:33 -04:00