How to use OctoDNS and DNS split authoritative configuration
Introduction | Building a robust system requires designing for failure. As Site Reliability Engineers (SREs) at GitHub, we're always looking to help mitigate issues through redundancy, and today we'll discuss recent work we've done to support you finding our servers via DNS. |
Large DNS providers have multiple levels of redundancy built into their services, and when an issue occurs that causes an outage, steps can be taken to mitigate its impact. One of the best options is to split your region's authoritative service among multiple service providers. Enabling split authority is as simple as configuring two or more sets of name servers for your zone at your domain registrar, and DNS requests will be split across the list. However, you must keep records in these areas synchronized across multiple providers, and depending on the situation this can be either complex to set up or a completely manual process.
$ dig NS github.com. @a.gtld-servers.net. ... ;; QUESTION SECTION: ;github.com. IN NS ;; AUTHORITY SECTION: github.com. 172800 IN NS ns4.p16.dynect.net. github.com. 172800 IN NS ns-520.awsdns-01.net. github.com. 172800 IN NS ns1.p16.dynect.net. github.com. 172800 IN NS ns3.p16.dynect.net. github.com. 172800 IN NS ns-421.awsdns-52.com. github.com. 172800 IN NS ns-1283.awsdns-32.org. github.com. 172800 IN NS ns2.p16.dynect.net. github.com. 172800 IN NS ns-1707.awsdns-21.co.uk. ...
The above query is to ask the TLD name server for the NS record of github.com. It returns the value that we configured in the domain registrar, in this case, there are two DNS service providers with four records each. If one of the providers experiences an outage, there is hope that the others can still service the request. We sync records everywhere and can safely modify them without worrying about stale data or incorrect state.
The final part of fully configuring split authority is to add all name servers in both DNS service providers as top-level NS records to the root of the zone.
$ dig NS github.com. @ns1.p16.dynect.net. ... ;; QUESTION SECTION: ;github.com. IN NS ;; ANSWER SECTION: github.com. 551 IN NS ns1.p16.dynect.net. github.com. 551 IN NS ns2.p16.dynect.net. github.com. 551 IN NS ns-520.awsdns-01.net. github.com. 551 IN NS ns3.p16.dynect.net. github.com. 551 IN NS ns-421.awsdns-52.com. github.com. 551 IN NS ns4.p16.dynect.net. github.com. 551 IN NS ns-1283.awsdns-32.org. github.com. 551 IN NS ns-1707.awsdns-21.co.uk.
At GitHub, we have dozens of areas and thousands of records, and most of these areas are not critical enough to require redundancy, so we only have to deal with a subset. We would like to have a solution that can keep these records synchronized across multiple DNS service providers, and more generally manage all DNS records internally and externally. So today we’re announcing OctoDNS.
ConfigurationOctoDNS allows us to reinvent our DNS workflow. Our regions and records are stored in configuration files in the Git repository. Use GitHub flows for changes to them and deploy them with branches just like a site. We can even make an "empty" deployment to preview which records will be modified in the change. Configuration files are yaml dictionaries, one per region, whose top-level keys are record names and key values are ttl, type, and type-specific data. For example, when included in the zone file github.com.yaml, the following configuration will create an A record for octodns.github.com.
octodns: type: A values: - 1.2.3.4 - 1.2.3.5
The second part of the configuration maps the sources of record data to DNS service providers. The following code snippet tells OctoDNS to load the zone github.com from the config provider and sync its results to dyn and route53.
zones: github.com.: sources: - config targets: - dyn - route53
Once our configuration is complete, OctoDNS can evaluate the current state and build a plan that outlines the set of changes that will be needed to match the target state to the source. In the example below, octodns.github.com is a new record, so the required action is to create records in both.
$ octodns-sync --config-file=./config/production.yaml ... ******************************************************************************** * github.com. ******************************************************************************** * route53 (Route53Provider) * Create * Summary: Creates=1, Updates=0, Deletes=0, Existing Records=0 * dyn (DynProvider) * Create * Summary: Creates=1, Updates=0, Deletes=0, Existing Records=0 ******************************************************************************** ...
By default octodns-sync is in simulated run mode, so no action will be taken. Once we have reviewed the changes and are happy with them, we can add the `--doit' flag and run the command again. OctoDNS will continue its processing flow, this time making the necessary changes in Route53 and Dynect to create the new record.
$ octodns-sync --config-file=./config/production.yaml --doit ...
At this point, we have the same data records in both DNS service providers and can easily split our DNS requests between them, knowing that they will provide accurate results. When we run the OctoDNS command above directly, our internal workflow relies on deployment scripts and chatops. You can find more information in the workflow section of the README.
SummarizeWe think most websites could benefit from splitting authority, and hopefully with OctoDNS, the biggest hurdle has been removed. Even if you're not interested in splitting authority, OctoDNS is still worth a look because it brings the benefits of infrastructure as code to DNS.
Want to help the GitHub SRE team solve interesting problems? We'd love to join us. Apply here.
The above is the detailed content of How to use OctoDNS and DNS split authoritative configuration. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

vscode built-in terminal is a development tool that allows running commands and scripts within the editor to simplify the development process. How to use vscode terminal: Open the terminal with the shortcut key (Ctrl/Cmd). Enter a command or run the script. Use hotkeys (such as Ctrl L to clear the terminal). Change the working directory (such as the cd command). Advanced features include debug mode, automatic code snippet completion, and interactive command history.

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

Causes and solutions for the VS Code terminal commands not available: The necessary tools are not installed (Windows: WSL; macOS: Xcode command line tools) Path configuration is wrong (add executable files to PATH environment variables) Permission issues (run VS Code as administrator) Firewall or proxy restrictions (check settings, unrestrictions) Terminal settings are incorrect (enable use of external terminals) VS Code installation is corrupt (reinstall or update) Terminal configuration is incompatible (try different terminal types or commands) Specific environment variables are missing (set necessary environment variables)

VS Code One-step/Next step shortcut key usage: One-step (backward): Windows/Linux: Ctrl ←; macOS: Cmd ←Next step (forward): Windows/Linux: Ctrl →; macOS: Cmd →

There are six ways to run code in Sublime: through hotkeys, menus, build systems, command lines, set default build systems, and custom build commands, and run individual files/projects by right-clicking on projects/files. The build system availability depends on the installation of Sublime Text.
