GithubHelp home page GithubHelp logo

njh / captivednsd Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 3.0 23 KB

captivednsd, the Captive Domain Name Server, returns same authorative response to every query.

Home Page: http://www.aelius.com/njh/captivednsd/

License: GNU General Public License v2.0

C 94.57% Makefile 5.43%

captivednsd's Introduction

captivednsd

captivednsd, the Captive Domain Name Server, returns same authorative response to every query. The reponse to 'A' queries and 'PTR' records are passed as a parameter on the command line. The code is covered by the GNU license.

I wrote the daemon to direct people to a captive web portal, on a system that was not connected to the Internet. This meant that it was not possible to resolve the correct IP address for a host and then redirect the query using a firewall.

captivednsd is based on the source code of scdns and Busybox's dnsd:

Usage

captivednsd [options] <ip> <host>
      -t <ttl>   Set the TTL for DNS responses (default 30).
      -p <port>  Port number to listen on (default 53).
      -b <addr>  Bind to an IP address (default 0.0.0.0).

Example

captivednsd 10.0.0.1 portal.local.
  • All A requests will return IP address 10.0.0.1.
  • All PTR requests will return portal.local.

captivednsd's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

captivednsd's Issues

Musl fix

captivedns doesn't compile under musl. The patch is simple:

diff --git a/captivednsd.c b/captivednsd.c
index 5992cf2..1c471ff 100644
--- a/captivednsd.c
+++ b/captivednsd.c
@@ -28,6 +28,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <ctype.h>
+#include <sys/select.h>
 
 #include "captivednsd.h"

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.