8000 GitHub - misshanya/dns-switcher: DNS server which uses first available upstream. Created for personal use on my router
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

misshanya/dns-switcher

Repository files navigation

DNS Switcher

Motivation

I have AdGuard Home on my PC. When I turn pc off, I need to switch DNS server on router (for me I need to turn off 'strict order' in OpenWRT settings).

I dont wanna go to settings every night and every morning.

What is it?

So I built simple DNS server which has my AdGuard Home as first upstream and Cloudflare as second upstream server. And when my PC is down it uses Cloudflare. When my PC is up it uses AdGuard Home on it. Automatically. That's what I needed.

How to use

Note

You must create config.json to run the server (see Config)

Standalone binary

  • Download binary for your platform from releases tab
  • Rename to dns-switcher (optional)
  • Run: ./dns-switcher

Docker

CLI

docker run -p 53:53 -v ./config.json:/app/config.json -d ghcr.io/misshanya/dns-switcher

Docker Compose

services:
  dns-switcher:
    container_name: dns-switcher-server
    image: ghcr.io/misshanya/dns-switcher
    ports:
      - "53:53"
    volumes:
      - ./config.json:/app/config.json
    restart: unless-stopped

Build from source

Requirements:

  • Go 1.24+
git clone https://github.com/misshanya/dns-switcher
cd dns-switcher
go build -o dns-switcher .

And run as usual binary

./dns-switcher

Config

Configure it via config.json

You can set the listen address and upstream servers. Example config:

{
    "address": ":53",
    "upstreams": [
        "1.1.1.1:53",
        "1.0.0.1:53"
    ]
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

DNS server which uses first available upstream. Created for personal use on my router

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •  
0