GithubHelp home page GithubHelp logo

ghost-dns's Introduction

ghost-dns

Reroutes all DNS traffic by (ab)using an LD_PRELOAD hack

Building:

The C makefile no longer works. Development is being done in the cpp directory. cd to the cpp directory and execute make

$ cd cpp && make

How To Use

$ ./run.sh <program>

Configuration

Currently, the configuration file is located at /etc/ghost.conf To change the configuration file location, define GHOSTDNS_CONFIG_FILE when compiling. Edit the Makefile definition to point to the ghost.conf file of your choice when compiling. See -DGHOSTDNS_CONF_FILE

Translations

Edit /etc/ghost.conf. To setup a translation use the following example:

some-website.com = 127.0.0.1 

The above example will replace all DNS calls to resolve 'some-website.com' to 127.0.0.1

Debug output

Lots of debug output if you're using large files. You can comment out the GDNS_DEBUG function body. Commenting out the define macro itself will likely result in build-time errors.

"All" feature

Edit /etc/ghost.conf. To make use of the "All" feature, use the following example:

!all = 192.8.33.4

This line of code will translate all DNS requests to the IP 192.8.33.4.

"localhost" feature

Edit /etc/ghost.conf. The "localhost" feature is merely a shortcut for !all = 127.0.0.1. To use it, put this in your config file:

!localhost

And that's it. Every request will be redirected to localhost

Planned features

  • Daemon that creates a shared memory object that allows the LD_PRELOAD'd process to access when trying to get dns translations/settings
  • Regular expression matching of hosts
  • Whitelisting. Any hosts that aren't in /etc/ghost.conf will be redirected to a black hole
  • Blacklisting.

Need to fix

  • As of now, the code is a mix between C style memory allocs (linked lists) and C++ style stuff. I want to eventually replace the linked lists with stl containers

Like to have

  • Allow user to specify a library and function to load. This function will be passed the host name and it shall return the translated IP

ghost-dns's People

Contributors

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