Code Monkey home page Code Monkey logo

zonedb's Introduction

Public Zone Database

build status godoc

The Public Zone Database (zonedb) is a free, open-source database containing a list and associated metadata of public DNS zones (domain name extensions). It attempts to be exhaustive, including current, retired, and withdrawn top-level domains and subdomains.

The intended use case is programs that interface with the public domain name system, including registry and registrar services. The data overlaps with and shares test cases with the Public Suffix List maintained by the Mozilla Foundation. The source data was originally derived from the internal zone database in use at Domainr.

Structure

The database consists of a list of zones (zones.txt) and associated metadata in JSON format.

zones.txt

The zones.txt file is a UTF-8 encoded text file containing a list of IDN & lower-case domain names, one per line, followed by a newline (\n) character. The domain names in zones.txt are sorted according to the following rules:

  1. Number of labels (top-level domains, followed by second- and third-level domains)
  2. Parent domain (e.g. uk)
  3. Subdomain (e.g. co.uk)

Metadata

Each domain with associated metadata will have a JSON file in the metadata directory.

Updates

A CircleCI workflow updates ZoneDB each night.

zones.txt

If a new SLD or third-level domain needs to be added to zones.txt, follow these steps locally:

  1. add the new zone to the bottom of the zones.txt file
  2. run make normalize to normalize the data
  3. run make update to run ZoneDB's update process
  4. create a pull request for the changes, and confirm the tests are passing

json files

If an update to one of the {zone}.json files is needed, do this locally:

  1. make normalize # tidies the json files, and runs go generate
  2. commit the changes

Implementations

Go

go get github.com/zonedb/zonedb

This repository contains a reference implementation of the database written in Go. Unlike the source data, which is in Unicode, the Go implementation represents domain names in ASCII IDNA form for interop with existing libraries.

Contributing

Fork this repository, make changes, and send a pull request. Before submitting a PR, run make normalize to normalize any changes. The data is structured to minimize diff size.

zonedb build tool

This database is generated and validated using the zonedb tool in this directory. To install, make sure you have a working Go installation (1.4+) and run this command:

go get -u github.com/zonedb/zonedb/cmd/zonedb

You can also run the zonedb tool directly: go run cmd/zonedb/main.go

Example commands

List all zones that have wildcarded DNS:

$ go run cmd/zonedb/main.go -list-wildcards

List all zones tagged geo:

$ go run cmd/zonedb/main.go -tags geo

List a given zone's tags:

$ go run cmd/zonedb/main.go -zones capetown -list-tags

Add a tag to multiple zones (and write the output):

$ go run cmd/zonedb/main.go -zones capetown,durban,joburg -add-tags city -w
$ make normalize

Remove a tag from a zone (and write the output):

$ go run cmd/zonedb/main.go -zones la -remove-tags generic -w

Add a location to a zone (and write the output):

$ go run cmd/zonedb/main.go -zones alsace -add-locations fr-a -w

License

This database is licensed under the Open Database License (ODBl) version 1.0. See LICENSE.md for more information.

Copyright ยฉ 2008โ€“2019 the Public Zone Database authors.

zonedb's People

Contributors

case avatar cee-dub avatar connyay avatar dependabot-preview[bot] avatar dependabot-support avatar domainrbot avatar philpennock avatar wbond avatar ydnar avatar zonedbot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.