Home System Tutorial LINUX How to use OctoDNS and DNS split authoritative configuration

How to use OctoDNS and DNS split authoritative configuration

Jan 02, 2024 pm 08:30 PM
linux linux tutorial Red Hat linux system linux command linux certification red hat linux linux video

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.
...
Copy after login

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.
Copy after login

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.

Configuration

OctoDNS 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
Copy after login

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
Copy after login
Synchronize

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
********************************************************************************
...
Copy after login

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
...
Copy after login

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.

Summarize

We 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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1655
14
PHP Tutorial
1252
29
C# Tutorial
1226
24
Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

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 terminal usage tutorial vscode terminal usage tutorial Apr 15, 2025 pm 10:09 PM

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.

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

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.

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

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.

What is the main purpose of Linux? What is the main purpose of Linux? Apr 16, 2025 am 12:19 AM

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.

vscode terminal command cannot be used vscode terminal command cannot be used Apr 15, 2025 pm 10:03 PM

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)

vscode Previous Next Shortcut Key vscode Previous Next Shortcut Key Apr 15, 2025 pm 10:51 PM

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 →

How to run sublime after writing the code How to run sublime after writing the code Apr 16, 2025 am 08:51 AM

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.

See all articles