Git Product home page Git Product logo

dddns's Introduction

DDDNS

A dynamic DNS system using libp2p. Uses a rendezvous point in the DHT to find the target peer.

The public IP of the node is obtained from the multiaddress array provided from libp2p, or from third party services as a fallback.

Each node in the network has an ID in the base32 form of it's public key, such as:

baareie5g66lu3ney2e4qfs2x3webynbaeoojkjxnd6dm36daas5k73vba

When running as a daemon, it can act as a DNS proxy, resolving domains with the "dddns" TLD, with the form:

baareie5g66lu3ney2e4qfs2x3webynbaeoojkjxnd6dm36daas5k73vba.dddns

and forwarding the rest to an upstream DNS server.

Build

To build:

go build ./cmd/dddns/dddns.go

With docker compose:

docker-compose build

Usage

NAME:
   dddns - A dynamic and distributed DNS system.

USAGE:
   dddns [global options] command [command options] [arguments...]

VERSION:
   0.1

COMMANDS:
   help, h  Shows a list of commands or help for one command

   client:
     client  Starts DDDNS in client mode

   daemon:
     daemon  Starts DDDNS in daemon mode

GLOBAL OPTIONS:
   --bootstrap-node value  The address a of bootstrap node. DDDNS will connect for peer discovery via DHT. Will use IPFS ones by default
   --datadir value         Path to store the data. (default: "/home/vdo/.dddns")
   --port value            Port used to listening and respond requests. (default: 44453)
   --protid value          The ID of the protocol. (default: "/dddns/1.0.0")
   --loglevel value        Log level of the output [debug,info,warn,error] (default: "info")
   --help, -h              show help
   --version, -v           print the version

To run as a daemon:

./dddns daemon [--dnsenable]

To run as client:

./dddns client --pubkey baareie5g66lu3ney2e4qfs2x3webynbaeoojkjxnd6dm36daas5k73vba

If you are running the deamon locally, it can act as a proxy adding the following line at the top of /etc/resolv.conf :

nameserver 127.0.0.1

then, you should be able to resolve .dddns hosts like the example:

$ dig @localhost baareie5g66lu3ney2e4qfs2x3webynbaeoojkjxnd6dm36daas5k73vba.dddns +short
108.61.209.8

Notes

In order to run the nameserver daemon a normal user, you need to add capabilities to bind the DNS port (53):

sudo setcap CAP_NET_BIND_SERVICE=+eip dddns

To-Do

  • Tests!
  • IPv6 support
  • Improve forwarding (only A now)
  • Use a simple PubSub system, like subpub
  • Add cache for faster resolution
  • Add a wrapper script to use alternative resolution (bubblewrap)

dddns's People

Contributors

eduadiez avatar vdo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.