├── .gitignore ├── Testfiles ├── dotcomTest.php ├── doteuTest.php └── dotnlTest.php ├── composer.json ├── composer.lock ├── readme.md ├── test.php └── validate.php /.gitignore: -------------------------------------------------------------------------------- 1 | /nbproject/private/ -------------------------------------------------------------------------------- /Testfiles/dotcomTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(validateDomain($domainname)); 28 | } 29 | 30 | 31 | 32 | 33 | } -------------------------------------------------------------------------------- /Testfiles/doteuTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(validateDomain($domainname)); 28 | } 29 | 30 | public function test_Success_Eurideu() 31 | { 32 | $domainname = 'eurid.eu'; 33 | $this->assertTrue(validateDomain($domainname)); 34 | } 35 | 36 | 37 | } -------------------------------------------------------------------------------- /Testfiles/dotnlTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(validateDomain($domainname)); 28 | } 29 | 30 | public function test_Success_Sidnnl() 31 | { 32 | $domainname = 'sidn.nl'; 33 | $this->assertTrue(validateDomain($domainname)); 34 | } 35 | 36 | 37 | } -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "metaregistrar/php-dnssec-validator", 3 | "description": "DNSSEC validation with only php required", 4 | "minimum-stability": "dev", 5 | "license": "proprietary", 6 | "authors": [ 7 | { 8 | "name": "Ewout de Graaf", 9 | "email": "ewout@metaregistrar.com" 10 | } 11 | ], 12 | "require": { 13 | "metaregistrar/php-dns-client": "dev-master" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "e8bbbd6c05fa82621aa40bafa53bdffa", 8 | "content-hash": "3b9984da9e276d637e92c5c481c8e495", 9 | "packages": [ 10 | { 11 | "name": "doctrine/instantiator", 12 | "version": "dev-master", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/doctrine/instantiator.git", 16 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", 21 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "php": ">=5.3,<8.0-DEV" 26 | }, 27 | "require-dev": { 28 | "athletic/athletic": "~0.1.8", 29 | "ext-pdo": "*", 30 | "ext-phar": "*", 31 | "phpunit/phpunit": "~4.0", 32 | "squizlabs/php_codesniffer": "~2.0" 33 | }, 34 | "type": "library", 35 | "extra": { 36 | "branch-alias": { 37 | "dev-master": "1.0.x-dev" 38 | } 39 | }, 40 | "autoload": { 41 | "psr-4": { 42 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 43 | } 44 | }, 45 | "notification-url": "https://packagist.org/downloads/", 46 | "license": [ 47 | "MIT" 48 | ], 49 | "authors": [ 50 | { 51 | "name": "Marco Pivetta", 52 | "email": "ocramius@gmail.com", 53 | "homepage": "http://ocramius.github.com/" 54 | } 55 | ], 56 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 57 | "homepage": "https://github.com/doctrine/instantiator", 58 | "keywords": [ 59 | "constructor", 60 | "instantiate" 61 | ], 62 | "time": "2015-06-14 21:17:01" 63 | }, 64 | { 65 | "name": "metaregistrar/php-dns-client", 66 | "version": "dev-master", 67 | "source": { 68 | "type": "git", 69 | "url": "https://github.com/metaregistrar/php-dns-client.git", 70 | "reference": "f150bbac7250aeacc21fa491844b851da8e8f3f1" 71 | }, 72 | "dist": { 73 | "type": "zip", 74 | "url": "https://api.github.com/repos/metaregistrar/php-dns-client/zipball/f150bbac7250aeacc21fa491844b851da8e8f3f1", 75 | "reference": "f150bbac7250aeacc21fa491844b851da8e8f3f1", 76 | "shasum": "" 77 | }, 78 | "require": { 79 | "phpunit/phpunit": "^4.8" 80 | }, 81 | "type": "library", 82 | "autoload": { 83 | "classmap": [ 84 | "DNS/" 85 | ] 86 | }, 87 | "notification-url": "https://packagist.org/downloads/", 88 | "license": [ 89 | "proprietary" 90 | ], 91 | "authors": [ 92 | { 93 | "name": "Ewout de Graaf", 94 | "email": "ewout@metaregistrar.com" 95 | } 96 | ], 97 | "description": "A php-only, object-oriented client that is able to read and process DNS records", 98 | "time": "2015-11-09 14:49:23" 99 | }, 100 | { 101 | "name": "phpdocumentor/reflection-docblock", 102 | "version": "2.0.4", 103 | "source": { 104 | "type": "git", 105 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 106 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" 107 | }, 108 | "dist": { 109 | "type": "zip", 110 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", 111 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", 112 | "shasum": "" 113 | }, 114 | "require": { 115 | "php": ">=5.3.3" 116 | }, 117 | "require-dev": { 118 | "phpunit/phpunit": "~4.0" 119 | }, 120 | "suggest": { 121 | "dflydev/markdown": "~1.0", 122 | "erusev/parsedown": "~1.0" 123 | }, 124 | "type": "library", 125 | "extra": { 126 | "branch-alias": { 127 | "dev-master": "2.0.x-dev" 128 | } 129 | }, 130 | "autoload": { 131 | "psr-0": { 132 | "phpDocumentor": [ 133 | "src/" 134 | ] 135 | } 136 | }, 137 | "notification-url": "https://packagist.org/downloads/", 138 | "license": [ 139 | "MIT" 140 | ], 141 | "authors": [ 142 | { 143 | "name": "Mike van Riel", 144 | "email": "mike.vanriel@naenius.com" 145 | } 146 | ], 147 | "time": "2015-02-03 12:10:50" 148 | }, 149 | { 150 | "name": "phpspec/prophecy", 151 | "version": "dev-master", 152 | "source": { 153 | "type": "git", 154 | "url": "https://github.com/phpspec/prophecy.git", 155 | "reference": "4f9b1eaf0a7da77c362f8d91cbc68ab1f4718d62" 156 | }, 157 | "dist": { 158 | "type": "zip", 159 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4f9b1eaf0a7da77c362f8d91cbc68ab1f4718d62", 160 | "reference": "4f9b1eaf0a7da77c362f8d91cbc68ab1f4718d62", 161 | "shasum": "" 162 | }, 163 | "require": { 164 | "doctrine/instantiator": "^1.0.2", 165 | "phpdocumentor/reflection-docblock": "~2.0", 166 | "sebastian/comparator": "~1.1" 167 | }, 168 | "require-dev": { 169 | "phpspec/phpspec": "~2.0" 170 | }, 171 | "type": "library", 172 | "extra": { 173 | "branch-alias": { 174 | "dev-master": "1.5.x-dev" 175 | } 176 | }, 177 | "autoload": { 178 | "psr-0": { 179 | "Prophecy\\": "src/" 180 | } 181 | }, 182 | "notification-url": "https://packagist.org/downloads/", 183 | "license": [ 184 | "MIT" 185 | ], 186 | "authors": [ 187 | { 188 | "name": "Konstantin Kudryashov", 189 | "email": "ever.zet@gmail.com", 190 | "homepage": "http://everzet.com" 191 | }, 192 | { 193 | "name": "Marcello Duarte", 194 | "email": "marcello.duarte@gmail.com" 195 | } 196 | ], 197 | "description": "Highly opinionated mocking framework for PHP 5.3+", 198 | "homepage": "https://github.com/phpspec/prophecy", 199 | "keywords": [ 200 | "Double", 201 | "Dummy", 202 | "fake", 203 | "mock", 204 | "spy", 205 | "stub" 206 | ], 207 | "time": "2015-09-22 14:49:23" 208 | }, 209 | { 210 | "name": "phpunit/php-code-coverage", 211 | "version": "2.2.x-dev", 212 | "source": { 213 | "type": "git", 214 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 215 | "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" 216 | }, 217 | "dist": { 218 | "type": "zip", 219 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", 220 | "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", 221 | "shasum": "" 222 | }, 223 | "require": { 224 | "php": ">=5.3.3", 225 | "phpunit/php-file-iterator": "~1.3", 226 | "phpunit/php-text-template": "~1.2", 227 | "phpunit/php-token-stream": "~1.3", 228 | "sebastian/environment": "^1.3.2", 229 | "sebastian/version": "~1.0" 230 | }, 231 | "require-dev": { 232 | "ext-xdebug": ">=2.1.4", 233 | "phpunit/phpunit": "~4" 234 | }, 235 | "suggest": { 236 | "ext-dom": "*", 237 | "ext-xdebug": ">=2.2.1", 238 | "ext-xmlwriter": "*" 239 | }, 240 | "type": "library", 241 | "extra": { 242 | "branch-alias": { 243 | "dev-master": "2.2.x-dev" 244 | } 245 | }, 246 | "autoload": { 247 | "classmap": [ 248 | "src/" 249 | ] 250 | }, 251 | "notification-url": "https://packagist.org/downloads/", 252 | "license": [ 253 | "BSD-3-Clause" 254 | ], 255 | "authors": [ 256 | { 257 | "name": "Sebastian Bergmann", 258 | "email": "sb@sebastian-bergmann.de", 259 | "role": "lead" 260 | } 261 | ], 262 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 263 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 264 | "keywords": [ 265 | "coverage", 266 | "testing", 267 | "xunit" 268 | ], 269 | "time": "2015-10-06 15:47:00" 270 | }, 271 | { 272 | "name": "phpunit/php-file-iterator", 273 | "version": "dev-master", 274 | "source": { 275 | "type": "git", 276 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 277 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" 278 | }, 279 | "dist": { 280 | "type": "zip", 281 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", 282 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", 283 | "shasum": "" 284 | }, 285 | "require": { 286 | "php": ">=5.3.3" 287 | }, 288 | "type": "library", 289 | "extra": { 290 | "branch-alias": { 291 | "dev-master": "1.4.x-dev" 292 | } 293 | }, 294 | "autoload": { 295 | "classmap": [ 296 | "src/" 297 | ] 298 | }, 299 | "notification-url": "https://packagist.org/downloads/", 300 | "license": [ 301 | "BSD-3-Clause" 302 | ], 303 | "authors": [ 304 | { 305 | "name": "Sebastian Bergmann", 306 | "email": "sb@sebastian-bergmann.de", 307 | "role": "lead" 308 | } 309 | ], 310 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 311 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 312 | "keywords": [ 313 | "filesystem", 314 | "iterator" 315 | ], 316 | "time": "2015-06-21 13:08:43" 317 | }, 318 | { 319 | "name": "phpunit/php-text-template", 320 | "version": "1.2.1", 321 | "source": { 322 | "type": "git", 323 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 324 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 325 | }, 326 | "dist": { 327 | "type": "zip", 328 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 329 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 330 | "shasum": "" 331 | }, 332 | "require": { 333 | "php": ">=5.3.3" 334 | }, 335 | "type": "library", 336 | "autoload": { 337 | "classmap": [ 338 | "src/" 339 | ] 340 | }, 341 | "notification-url": "https://packagist.org/downloads/", 342 | "license": [ 343 | "BSD-3-Clause" 344 | ], 345 | "authors": [ 346 | { 347 | "name": "Sebastian Bergmann", 348 | "email": "sebastian@phpunit.de", 349 | "role": "lead" 350 | } 351 | ], 352 | "description": "Simple template engine.", 353 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 354 | "keywords": [ 355 | "template" 356 | ], 357 | "time": "2015-06-21 13:50:34" 358 | }, 359 | { 360 | "name": "phpunit/php-timer", 361 | "version": "dev-master", 362 | "source": { 363 | "type": "git", 364 | "url": "https://github.com/sebastianbergmann/php-timer.git", 365 | "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" 366 | }, 367 | "dist": { 368 | "type": "zip", 369 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", 370 | "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", 371 | "shasum": "" 372 | }, 373 | "require": { 374 | "php": ">=5.3.3" 375 | }, 376 | "type": "library", 377 | "autoload": { 378 | "classmap": [ 379 | "src/" 380 | ] 381 | }, 382 | "notification-url": "https://packagist.org/downloads/", 383 | "license": [ 384 | "BSD-3-Clause" 385 | ], 386 | "authors": [ 387 | { 388 | "name": "Sebastian Bergmann", 389 | "email": "sb@sebastian-bergmann.de", 390 | "role": "lead" 391 | } 392 | ], 393 | "description": "Utility class for timing", 394 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 395 | "keywords": [ 396 | "timer" 397 | ], 398 | "time": "2015-06-21 08:01:12" 399 | }, 400 | { 401 | "name": "phpunit/php-token-stream", 402 | "version": "dev-master", 403 | "source": { 404 | "type": "git", 405 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 406 | "reference": "cab6c6fefee93d7b7c3a01292a0fe0884ea66644" 407 | }, 408 | "dist": { 409 | "type": "zip", 410 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/cab6c6fefee93d7b7c3a01292a0fe0884ea66644", 411 | "reference": "cab6c6fefee93d7b7c3a01292a0fe0884ea66644", 412 | "shasum": "" 413 | }, 414 | "require": { 415 | "ext-tokenizer": "*", 416 | "php": ">=5.3.3" 417 | }, 418 | "require-dev": { 419 | "phpunit/phpunit": "~4.2" 420 | }, 421 | "type": "library", 422 | "extra": { 423 | "branch-alias": { 424 | "dev-master": "1.4-dev" 425 | } 426 | }, 427 | "autoload": { 428 | "classmap": [ 429 | "src/" 430 | ] 431 | }, 432 | "notification-url": "https://packagist.org/downloads/", 433 | "license": [ 434 | "BSD-3-Clause" 435 | ], 436 | "authors": [ 437 | { 438 | "name": "Sebastian Bergmann", 439 | "email": "sebastian@phpunit.de" 440 | } 441 | ], 442 | "description": "Wrapper around PHP's tokenizer extension.", 443 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 444 | "keywords": [ 445 | "tokenizer" 446 | ], 447 | "time": "2015-09-23 14:46:55" 448 | }, 449 | { 450 | "name": "phpunit/phpunit", 451 | "version": "4.8.x-dev", 452 | "source": { 453 | "type": "git", 454 | "url": "https://github.com/sebastianbergmann/phpunit.git", 455 | "reference": "9f57eb4797ad108d8dde64313d3d96e24347b81a" 456 | }, 457 | "dist": { 458 | "type": "zip", 459 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9f57eb4797ad108d8dde64313d3d96e24347b81a", 460 | "reference": "9f57eb4797ad108d8dde64313d3d96e24347b81a", 461 | "shasum": "" 462 | }, 463 | "require": { 464 | "ext-dom": "*", 465 | "ext-json": "*", 466 | "ext-pcre": "*", 467 | "ext-reflection": "*", 468 | "ext-spl": "*", 469 | "php": ">=5.3.3", 470 | "phpspec/prophecy": "^1.3.1", 471 | "phpunit/php-code-coverage": "~2.1", 472 | "phpunit/php-file-iterator": "~1.4", 473 | "phpunit/php-text-template": "~1.2", 474 | "phpunit/php-timer": ">=1.0.6", 475 | "phpunit/phpunit-mock-objects": "~2.3", 476 | "sebastian/comparator": "~1.1", 477 | "sebastian/diff": "~1.2", 478 | "sebastian/environment": "~1.3", 479 | "sebastian/exporter": "~1.2", 480 | "sebastian/global-state": "~1.0", 481 | "sebastian/version": "~1.0", 482 | "symfony/yaml": "~2.1|~3.0" 483 | }, 484 | "suggest": { 485 | "phpunit/php-invoker": "~1.1" 486 | }, 487 | "bin": [ 488 | "phpunit" 489 | ], 490 | "type": "library", 491 | "extra": { 492 | "branch-alias": { 493 | "dev-master": "4.8.x-dev" 494 | } 495 | }, 496 | "autoload": { 497 | "classmap": [ 498 | "src/" 499 | ] 500 | }, 501 | "notification-url": "https://packagist.org/downloads/", 502 | "license": [ 503 | "BSD-3-Clause" 504 | ], 505 | "authors": [ 506 | { 507 | "name": "Sebastian Bergmann", 508 | "email": "sebastian@phpunit.de", 509 | "role": "lead" 510 | } 511 | ], 512 | "description": "The PHP Unit Testing framework.", 513 | "homepage": "https://phpunit.de/", 514 | "keywords": [ 515 | "phpunit", 516 | "testing", 517 | "xunit" 518 | ], 519 | "time": "2015-11-04 15:12:39" 520 | }, 521 | { 522 | "name": "phpunit/phpunit-mock-objects", 523 | "version": "2.3.x-dev", 524 | "source": { 525 | "type": "git", 526 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 527 | "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" 528 | }, 529 | "dist": { 530 | "type": "zip", 531 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", 532 | "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", 533 | "shasum": "" 534 | }, 535 | "require": { 536 | "doctrine/instantiator": "^1.0.2", 537 | "php": ">=5.3.3", 538 | "phpunit/php-text-template": "~1.2", 539 | "sebastian/exporter": "~1.2" 540 | }, 541 | "require-dev": { 542 | "phpunit/phpunit": "~4.4" 543 | }, 544 | "suggest": { 545 | "ext-soap": "*" 546 | }, 547 | "type": "library", 548 | "extra": { 549 | "branch-alias": { 550 | "dev-master": "2.3.x-dev" 551 | } 552 | }, 553 | "autoload": { 554 | "classmap": [ 555 | "src/" 556 | ] 557 | }, 558 | "notification-url": "https://packagist.org/downloads/", 559 | "license": [ 560 | "BSD-3-Clause" 561 | ], 562 | "authors": [ 563 | { 564 | "name": "Sebastian Bergmann", 565 | "email": "sb@sebastian-bergmann.de", 566 | "role": "lead" 567 | } 568 | ], 569 | "description": "Mock Object library for PHPUnit", 570 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 571 | "keywords": [ 572 | "mock", 573 | "xunit" 574 | ], 575 | "time": "2015-10-02 06:51:40" 576 | }, 577 | { 578 | "name": "sebastian/comparator", 579 | "version": "dev-master", 580 | "source": { 581 | "type": "git", 582 | "url": "https://github.com/sebastianbergmann/comparator.git", 583 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" 584 | }, 585 | "dist": { 586 | "type": "zip", 587 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", 588 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", 589 | "shasum": "" 590 | }, 591 | "require": { 592 | "php": ">=5.3.3", 593 | "sebastian/diff": "~1.2", 594 | "sebastian/exporter": "~1.2" 595 | }, 596 | "require-dev": { 597 | "phpunit/phpunit": "~4.4" 598 | }, 599 | "type": "library", 600 | "extra": { 601 | "branch-alias": { 602 | "dev-master": "1.2.x-dev" 603 | } 604 | }, 605 | "autoload": { 606 | "classmap": [ 607 | "src/" 608 | ] 609 | }, 610 | "notification-url": "https://packagist.org/downloads/", 611 | "license": [ 612 | "BSD-3-Clause" 613 | ], 614 | "authors": [ 615 | { 616 | "name": "Jeff Welch", 617 | "email": "whatthejeff@gmail.com" 618 | }, 619 | { 620 | "name": "Volker Dusch", 621 | "email": "github@wallbash.com" 622 | }, 623 | { 624 | "name": "Bernhard Schussek", 625 | "email": "bschussek@2bepublished.at" 626 | }, 627 | { 628 | "name": "Sebastian Bergmann", 629 | "email": "sebastian@phpunit.de" 630 | } 631 | ], 632 | "description": "Provides the functionality to compare PHP values for equality", 633 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 634 | "keywords": [ 635 | "comparator", 636 | "compare", 637 | "equality" 638 | ], 639 | "time": "2015-07-26 15:48:44" 640 | }, 641 | { 642 | "name": "sebastian/diff", 643 | "version": "dev-master", 644 | "source": { 645 | "type": "git", 646 | "url": "https://github.com/sebastianbergmann/diff.git", 647 | "reference": "6899b3e33bfbd386d88b5eea5f65f563e8793051" 648 | }, 649 | "dist": { 650 | "type": "zip", 651 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/6899b3e33bfbd386d88b5eea5f65f563e8793051", 652 | "reference": "6899b3e33bfbd386d88b5eea5f65f563e8793051", 653 | "shasum": "" 654 | }, 655 | "require": { 656 | "php": ">=5.3.3" 657 | }, 658 | "require-dev": { 659 | "phpunit/phpunit": "~4.2" 660 | }, 661 | "type": "library", 662 | "extra": { 663 | "branch-alias": { 664 | "dev-master": "1.3-dev" 665 | } 666 | }, 667 | "autoload": { 668 | "classmap": [ 669 | "src/" 670 | ] 671 | }, 672 | "notification-url": "https://packagist.org/downloads/", 673 | "license": [ 674 | "BSD-3-Clause" 675 | ], 676 | "authors": [ 677 | { 678 | "name": "Kore Nordmann", 679 | "email": "mail@kore-nordmann.de" 680 | }, 681 | { 682 | "name": "Sebastian Bergmann", 683 | "email": "sebastian@phpunit.de" 684 | } 685 | ], 686 | "description": "Diff implementation", 687 | "homepage": "http://www.github.com/sebastianbergmann/diff", 688 | "keywords": [ 689 | "diff" 690 | ], 691 | "time": "2015-06-22 14:15:55" 692 | }, 693 | { 694 | "name": "sebastian/environment", 695 | "version": "dev-master", 696 | "source": { 697 | "type": "git", 698 | "url": "https://github.com/sebastianbergmann/environment.git", 699 | "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" 700 | }, 701 | "dist": { 702 | "type": "zip", 703 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", 704 | "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", 705 | "shasum": "" 706 | }, 707 | "require": { 708 | "php": ">=5.3.3" 709 | }, 710 | "require-dev": { 711 | "phpunit/phpunit": "~4.4" 712 | }, 713 | "type": "library", 714 | "extra": { 715 | "branch-alias": { 716 | "dev-master": "1.3.x-dev" 717 | } 718 | }, 719 | "autoload": { 720 | "classmap": [ 721 | "src/" 722 | ] 723 | }, 724 | "notification-url": "https://packagist.org/downloads/", 725 | "license": [ 726 | "BSD-3-Clause" 727 | ], 728 | "authors": [ 729 | { 730 | "name": "Sebastian Bergmann", 731 | "email": "sebastian@phpunit.de" 732 | } 733 | ], 734 | "description": "Provides functionality to handle HHVM/PHP environments", 735 | "homepage": "http://www.github.com/sebastianbergmann/environment", 736 | "keywords": [ 737 | "Xdebug", 738 | "environment", 739 | "hhvm" 740 | ], 741 | "time": "2015-08-03 06:14:51" 742 | }, 743 | { 744 | "name": "sebastian/exporter", 745 | "version": "dev-master", 746 | "source": { 747 | "type": "git", 748 | "url": "https://github.com/sebastianbergmann/exporter.git", 749 | "reference": "f88f8936517d54ae6d589166810877fb2015d0a2" 750 | }, 751 | "dist": { 752 | "type": "zip", 753 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f88f8936517d54ae6d589166810877fb2015d0a2", 754 | "reference": "f88f8936517d54ae6d589166810877fb2015d0a2", 755 | "shasum": "" 756 | }, 757 | "require": { 758 | "php": ">=5.3.3", 759 | "sebastian/recursion-context": "~1.0" 760 | }, 761 | "require-dev": { 762 | "ext-mbstring": "*", 763 | "phpunit/phpunit": "~4.4" 764 | }, 765 | "type": "library", 766 | "extra": { 767 | "branch-alias": { 768 | "dev-master": "1.3.x-dev" 769 | } 770 | }, 771 | "autoload": { 772 | "classmap": [ 773 | "src/" 774 | ] 775 | }, 776 | "notification-url": "https://packagist.org/downloads/", 777 | "license": [ 778 | "BSD-3-Clause" 779 | ], 780 | "authors": [ 781 | { 782 | "name": "Jeff Welch", 783 | "email": "whatthejeff@gmail.com" 784 | }, 785 | { 786 | "name": "Volker Dusch", 787 | "email": "github@wallbash.com" 788 | }, 789 | { 790 | "name": "Bernhard Schussek", 791 | "email": "bschussek@2bepublished.at" 792 | }, 793 | { 794 | "name": "Sebastian Bergmann", 795 | "email": "sebastian@phpunit.de" 796 | }, 797 | { 798 | "name": "Adam Harvey", 799 | "email": "aharvey@php.net" 800 | } 801 | ], 802 | "description": "Provides the functionality to export PHP variables for visualization", 803 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 804 | "keywords": [ 805 | "export", 806 | "exporter" 807 | ], 808 | "time": "2015-08-09 04:23:41" 809 | }, 810 | { 811 | "name": "sebastian/global-state", 812 | "version": "1.1.1", 813 | "source": { 814 | "type": "git", 815 | "url": "https://github.com/sebastianbergmann/global-state.git", 816 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" 817 | }, 818 | "dist": { 819 | "type": "zip", 820 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", 821 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", 822 | "shasum": "" 823 | }, 824 | "require": { 825 | "php": ">=5.3.3" 826 | }, 827 | "require-dev": { 828 | "phpunit/phpunit": "~4.2" 829 | }, 830 | "suggest": { 831 | "ext-uopz": "*" 832 | }, 833 | "type": "library", 834 | "extra": { 835 | "branch-alias": { 836 | "dev-master": "1.0-dev" 837 | } 838 | }, 839 | "autoload": { 840 | "classmap": [ 841 | "src/" 842 | ] 843 | }, 844 | "notification-url": "https://packagist.org/downloads/", 845 | "license": [ 846 | "BSD-3-Clause" 847 | ], 848 | "authors": [ 849 | { 850 | "name": "Sebastian Bergmann", 851 | "email": "sebastian@phpunit.de" 852 | } 853 | ], 854 | "description": "Snapshotting of global state", 855 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 856 | "keywords": [ 857 | "global state" 858 | ], 859 | "time": "2015-10-12 03:26:01" 860 | }, 861 | { 862 | "name": "sebastian/recursion-context", 863 | "version": "dev-master", 864 | "source": { 865 | "type": "git", 866 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 867 | "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" 868 | }, 869 | "dist": { 870 | "type": "zip", 871 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", 872 | "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", 873 | "shasum": "" 874 | }, 875 | "require": { 876 | "php": ">=5.3.3" 877 | }, 878 | "require-dev": { 879 | "phpunit/phpunit": "~4.4" 880 | }, 881 | "type": "library", 882 | "extra": { 883 | "branch-alias": { 884 | "dev-master": "1.0.x-dev" 885 | } 886 | }, 887 | "autoload": { 888 | "classmap": [ 889 | "src/" 890 | ] 891 | }, 892 | "notification-url": "https://packagist.org/downloads/", 893 | "license": [ 894 | "BSD-3-Clause" 895 | ], 896 | "authors": [ 897 | { 898 | "name": "Jeff Welch", 899 | "email": "whatthejeff@gmail.com" 900 | }, 901 | { 902 | "name": "Sebastian Bergmann", 903 | "email": "sebastian@phpunit.de" 904 | }, 905 | { 906 | "name": "Adam Harvey", 907 | "email": "aharvey@php.net" 908 | } 909 | ], 910 | "description": "Provides functionality to recursively process PHP variables", 911 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 912 | "time": "2015-06-21 08:04:50" 913 | }, 914 | { 915 | "name": "sebastian/version", 916 | "version": "1.0.6", 917 | "source": { 918 | "type": "git", 919 | "url": "https://github.com/sebastianbergmann/version.git", 920 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" 921 | }, 922 | "dist": { 923 | "type": "zip", 924 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", 925 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", 926 | "shasum": "" 927 | }, 928 | "type": "library", 929 | "autoload": { 930 | "classmap": [ 931 | "src/" 932 | ] 933 | }, 934 | "notification-url": "https://packagist.org/downloads/", 935 | "license": [ 936 | "BSD-3-Clause" 937 | ], 938 | "authors": [ 939 | { 940 | "name": "Sebastian Bergmann", 941 | "email": "sebastian@phpunit.de", 942 | "role": "lead" 943 | } 944 | ], 945 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 946 | "homepage": "https://github.com/sebastianbergmann/version", 947 | "time": "2015-06-21 13:59:46" 948 | }, 949 | { 950 | "name": "symfony/yaml", 951 | "version": "dev-master", 952 | "source": { 953 | "type": "git", 954 | "url": "https://github.com/symfony/yaml.git", 955 | "reference": "1fac4249ca3ea5949685fe36ca1eaceac19fd906" 956 | }, 957 | "dist": { 958 | "type": "zip", 959 | "url": "https://api.github.com/repos/symfony/yaml/zipball/1fac4249ca3ea5949685fe36ca1eaceac19fd906", 960 | "reference": "1fac4249ca3ea5949685fe36ca1eaceac19fd906", 961 | "shasum": "" 962 | }, 963 | "require": { 964 | "php": ">=5.5.9" 965 | }, 966 | "type": "library", 967 | "extra": { 968 | "branch-alias": { 969 | "dev-master": "3.0-dev" 970 | } 971 | }, 972 | "autoload": { 973 | "psr-4": { 974 | "Symfony\\Component\\Yaml\\": "" 975 | }, 976 | "exclude-from-classmap": [ 977 | "/Tests/" 978 | ] 979 | }, 980 | "notification-url": "https://packagist.org/downloads/", 981 | "license": [ 982 | "MIT" 983 | ], 984 | "authors": [ 985 | { 986 | "name": "Fabien Potencier", 987 | "email": "fabien@symfony.com" 988 | }, 989 | { 990 | "name": "Symfony Community", 991 | "homepage": "https://symfony.com/contributors" 992 | } 993 | ], 994 | "description": "Symfony Yaml Component", 995 | "homepage": "https://symfony.com", 996 | "time": "2015-11-09 10:46:27" 997 | } 998 | ], 999 | "packages-dev": [], 1000 | "aliases": [], 1001 | "minimum-stability": "dev", 1002 | "stability-flags": { 1003 | "metaregistrar/php-dns-client": 20 1004 | }, 1005 | "prefer-stable": false, 1006 | "prefer-lowest": false, 1007 | "platform": [], 1008 | "platform-dev": [] 1009 | } 1010 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | Ever wanted to do DNSSEC validation in PHP? 2 | 3 | This dnssec validator is written in 100% PHP5. It contains an object-oriented DNS module that can retrieve any record from a nameserver. 4 | 5 | No other modules or downloads needed 6 | 7 | The validator has been tested extensively on .NL and .EU domain names, but not on other ones. 8 | 9 | Please feel free to test, use, add or modify. 10 | 11 | To use this suite: 12 | - Clone this repository 13 | - php test.php domainname 14 | 15 | At this time it will only test .nl, .eu and .com domains because the nameservers are known for these extensions. Nameservers can be added for other extensions. 16 | See DNS/dnsProtocol.php function registrynameservers() -------------------------------------------------------------------------------- /test.php: -------------------------------------------------------------------------------- 1 | \n\n"); 7 | } 8 | $domainname = $argv[1]; 9 | 10 | try { 11 | validateDomain($domainname); 12 | echo "$domainname validation succesful\n"; 13 | } catch (Metaregistrar\DNS\DnsException $e) { 14 | echo "ERROR: ".$e->getMessage()."\n"; 15 | } -------------------------------------------------------------------------------- /validate.php: -------------------------------------------------------------------------------- 1 | registrynameservers($tld); 16 | if (!is_array($dnsservers)) 17 | { 18 | throw new Metaregistrar\DNS\dnsException("DNSSEC validation not supported yet for the domain name ".$domainname); 19 | } 20 | foreach ($dnsservers as $dnsserver) 21 | { 22 | $dns->setServer($dnsserver); 23 | $result = $dns->Query($domainname,'NS'); 24 | if ($result->getNameserverResultCount()>0) 25 | { 26 | $ns = $result->getNameserverResults(); 27 | foreach ($ns as $n) 28 | { 29 | /* @var $n Metaregistrar\DNS\dnsNSresult */ 30 | $nameservers[]=$n->getNameserver(); 31 | } 32 | $result = $dns->Query($domainname,'DS'); 33 | if ($result->getResourceResultCount()==0) 34 | { 35 | # 36 | # No DS record found at parent: domain is not secured 37 | # 38 | throw new Metaregistrar\DNS\dnsException("No DS record found at parent: Domainname is not secured"); 39 | } 40 | else 41 | { 42 | $ds = $result->getResourceResults(); 43 | foreach ($ds as $d) 44 | { 45 | /* @var $d Metaregistrar\DNS\dnsDSresult */ 46 | $pk['key']=$d->getKey(); 47 | $pk['keytag']=$d->getKeytag(); 48 | $pk['algorithm']=$d->getAlgorithm(); 49 | $pk['matched']=false; 50 | $parentkeys[]=$pk; 51 | } 52 | } 53 | break; 54 | } 55 | } 56 | 57 | # 58 | # Retrieve all necessary records 59 | # 60 | if (isset($nameservers) && is_array($nameservers)) { 61 | foreach ($nameservers as $ns) 62 | { 63 | $dns->setServer($ns); 64 | $result = $dns->Query($domainname,'RRSIG'); 65 | if ($result->getResourceResultCount()==0) 66 | { 67 | throw new Metaregistrar\DNS\dnsException("No RRSIG records found on ".$ns." for domain name ".$domainname); 68 | } 69 | else 70 | { 71 | $rrsigs = $result->getResourceResults(); 72 | if (is_array($rrsigs)) { 73 | foreach ($rrsigs as $rrsig) 74 | { 75 | /* @var $rrsig Metaregistrar\DNS\dnsRRSIGresult */ 76 | if ($rrsig->getTypeCovered()=='SOA') 77 | { 78 | $rr[$ns]=$rrsig; 79 | } 80 | } 81 | } 82 | } 83 | $result2 = $dns->Query($domainname,'DNSKEY'); 84 | if ($result2->getResourceResultCount()==0) 85 | { 86 | throw new Metaregistrar\DNS\dnsException("No DNSKEY records found on ".$ns." for domain name ".$domainname); 87 | } 88 | else 89 | { 90 | $ds = $result2->getResourceResults(); 91 | foreach ($ds as $childkey) 92 | { 93 | /* @var $childkey Metaregistrar\DNS\dnsDNSKEYresult */ 94 | if ($childkey->getSep()) 95 | { 96 | $dnskey[$ns]=$childkey; 97 | } 98 | } 99 | } 100 | if ((!isset($rr)) || (!$rr[$ns])) 101 | { 102 | throw new Metaregistrar\DNS\dnsException("No matching resource record type SOA found on ".$ns." for ".$domainname); 103 | } 104 | if ((!isset($dnskey)) || (!$dnskey[$ns])) 105 | { 106 | throw new Metaregistrar\DNS\dnsException("No matching DNSKEY record found with SEP flag enabled on ".$ns." for $domainname"); 107 | } 108 | validateRRSIG($domainname, $rr[$ns], $ds); 109 | validateDNSKEY($domainname, $dnskey[$ns], $parentkeys); 110 | } 111 | } 112 | return true; 113 | } 114 | 115 | 116 | function validateDNSKEY($domainname, Metaregistrar\DNS\dnsDNSKEYresult $dnskey, $parentkeys) 117 | { 118 | $validkeyfound = false; 119 | foreach ($parentkeys as $index=>$parentkey) 120 | { 121 | if ($dnskey->getKeytag()==$parentkey['keytag']) 122 | { 123 | # 124 | # Algorithms for SEP key and parent key must match 125 | # 126 | $validkeyfound = true; 127 | $parentkeys[$index]['matched']=true; 128 | if ($parentkey['algorithm']!=$dnskey->getAlgorithm()) 129 | { 130 | throw new Metaregistrar\DNS\dnsException("Parent ($parentkey[algorithm]) and child (".$dnskey->getAlgorithm().") algorithms for key ".$dnskey->getKeytag()." do not match for ".$domainname); 131 | } 132 | } 133 | else 134 | { 135 | //$algo = $dnskey->algorithm($dnskey->getAlgorithm()); 136 | } 137 | 138 | } 139 | foreach ($parentkeys as $parentkey) 140 | { 141 | if (!$parentkey['matched']) 142 | { 143 | throw new Metaregistrar\DNS\dnsException('No match found for parent key '.$parentkey['keytag']); 144 | } 145 | } 146 | if (!$validkeyfound) 147 | { 148 | throw new Metaregistrar\DNS\dnsException("No valid key with SEP found for domain name ".$domainname); 149 | } 150 | } 151 | 152 | 153 | function validateRRSIG($domainname, Metaregistrar\DNS\dnsRRSIGresult $rrsig, $ds) 154 | { 155 | # 156 | # Inception timestamp must lie in the past 157 | # 158 | if ($rrsig->getInceptionTimestamp() > time()) 159 | { 160 | 161 | throw new Metaregistrar\DNS\dnsException("Key ".$rrsig->getKeytag()." for domain name ".$domainname." is not yet valid: starts on ".$rrsig->getInceptionDate()); 162 | } 163 | # 164 | # Expiration timestamp must lie in the future 165 | # 166 | if ($rrsig->getExpirationTimestamp() < time()) 167 | { 168 | throw new Metaregistrar\DNS\dnsException("Key ".$rrsig->getKeytag()." for domain name ".$domainname." has expired at ".$rrsig->getExpirationDate()); 169 | } 170 | # 171 | # Signer name must be equal to domain name 172 | # 173 | if ($rrsig->getSignername()!=$domainname) 174 | { 175 | throw new Metaregistrar\DNS\dnsException("RRSIG signer name ".$rrsig->getSignername()." for domain name ".$domainname." is incorrect"); 176 | } 177 | # 178 | # Keytag for signing must exist in the DNSKEY records 179 | # 180 | $keyfound = false; 181 | if (is_array($ds)) { 182 | foreach ($ds as $childkey) 183 | { 184 | /* @var $childkey Metaregistrar\DNS\dnsRRSIGresult */ 185 | if ($childkey->getKeytag()==$rrsig->getKeytag()) 186 | { 187 | $keyfound = true; 188 | } 189 | } 190 | } 191 | if (!$keyfound) 192 | { 193 | throw new Metaregistrar\DNS\dnsException("Keytag ".$rrsig->getKeytag()." cannot be found in the DNSKEY records for domain name ".$domainname." to validate RRSIG"); 194 | } 195 | } 196 | --------------------------------------------------------------------------------