Git Product home page Git Product logo

dns-heaven's Introduction

dns-heaven

dns-heaven fixes macOS DNS stack by enabling the usage of the native DNS stack through /etc/resolv.conf.

Overview

Some programs like dig, nslookup and anything compiled with Go doesn't use macOS native name resolution stack. This makes some features like split DNS to not work with those programs.

This occurs because macOS native name resolution uses a set of rules that aren't compatible with resolv.conf. This includes:

  • Per interface DNS settings (scoped)
  • Per domain settings

In order to support programs that uses resolv.conf, macOS writes a file with only the primary name server and search domains that were configured either through DHCP or manually.

Installation

Just run:

sudo sh -c "curl -s -L https://raw.githubusercontent.com/dkaukov/dns-heaven/master/install.sh | bash"

This script downloads the latest version and installs a LaunchAgent making sure that dns-heaven is always running.

If you want to do this manually, just download the latest release or compile dns-heaven yourself, and make sure it's always running.

Uninstall

Just run:

sudo sh -c "curl -s -L https://raw.githubusercontent.com/dkaukov/dns-heaven/master/uninstall.sh | bash" 

How it works

dns-heaven exposes a DNS server that acts as a proxy mimicking native macOS behaviour. This is accomplished by periodically reading the output of scutil --dns and updating upstream rules and nameservers.

It also keeps /etc/resolv.conf pointing to 127.0.0.1 as the system will rewrite this file whenever your network settings changes (e.g.: changing wifi network).

Alternatives

dnsmasq

This is one of the best options but it has some drawbacks. In order to use dnsmasq you need to manually specify it on network settings and manually configure the upstream forwarders. This is bad because sometimes you want to use the servers announced on DHCP instead of something static like 8.8.8.8 and 8.8.4.4.

Relsease

goreleaser release

License

MIT.

dns-heaven's People

Contributors

dkaukov avatar greenboxal avatar tresni avatar

Stargazers

Branden Cash avatar Pablo Ruiz García 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.