Git Product home page Git Product logo

magan's Introduction

Magan

Magan is a DNS over HTTPS (DoH) server.

DNS dates back to the gentler days of Internet when clear text transmissions were considered quite OK.

Unencrypted DNS Traffic

These days, there is increasing awareness among users to encrypt their traffic, including DNS.

Magan handles your incoming DNS requests and retrieves appropriate responses from Google Public DNS over HTTPS - thereby encrypting your otherwise clear-text DNS traffic.

Encrypted DNS Traffic

The C version is recommended; also available are the Go and Python3 variants.

A few pre-built binaries for Linux and Windows are available here.

See here for running Magan as a Windows OS Service.

Build instructions

The C version

We need libcurl4-openssl-dev and libjson-c, usually installed on Debian thusly:

$ sudo apt install libjson-c libcurl4-openssl-dev

or, try

$ sudo apt install libjson-c-dev libcurl4-openssl-dev
Once all the pre-requisites are met, compile magan as:

$ gcc -Wall -Wvla -Wextra magan.c -pthread -lcurl -ljson-c -o magan-$(uname -m) 

(Also see make.sh.)

Building the Go variant

See make_go_binaries.sh

The Python3 Version

We need latest scapy:

$ pip3 install scapy

and then:

$ ./magan.py -h
Usage:
  -h  --help         print this usage and exit
  -p  --port         alternate port to listen
  -v  --version      print version information and exit

Basic Usage

$ ./magan --help
Usage: ./magan [options]
  -h  --help         print this usage and exit
  -p  --port         alternate port to listen
  -v  --version      print version information and exit

to listen on non-privileged port

You don't need root privileges if you are using port > 1024:

$ ./magan-armv7l -p 3131
Thu Apr  4 19:34:48 2019 Magan[26795]: Magan/1.2
Thu Apr  4 19:34:48 2019 Magan[26795]: Listening on port: 3131
Thu Apr  4 19:34:48 2019 Magan[26795]: Ready
..

to listen on privileged port

you'd need root privs if you want to listen in on port number less than 1024

$ sudo ./magan-armv7l 
Thu Apr  4 19:35:20 2019 Magan[26823]: Magan/1.2
Thu Apr  4 19:35:20 2019 Magan[26823]: Listening on port: 53
Thu Apr  4 19:35:20 2019 Magan[26823]: Ready
..

Startup

Startup can be as simple as adding a line to your /etc/crontab:

*/5 * * * *    someuser     /usr/local/bin/magan -p 1039 1>/dev/null 2>/dev/null

If you are running as root, then:

*/5 * * * *    root     /usr/local/bin/magan -p 53 1>/dev/null 2>/dev/null

Changelog

See Changelog

magan's People

Contributors

evuraan avatar

Stargazers

jubin jose avatar Émilien (perso) 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.