Dns focus is an open source DNS server that allows you to easily block unwanted domains for your focus
By sharing your DNS server on a network, your friends can link your DNS server to start a friendly working session with the same blocked DNS.
- Blocking unwanted domain
- IPv4 support
- udp support
- Easy to set up and use
- dns proxy
- Golang or Docker
-
Clone the repo :
git clone https://github.com/RemyMach/dns-focus.git
-
Compile the project (to use in your go environment)(not needed if use in docker)
go build -o main
-
WARNING Configure your system or device to use the DNS server by following the instructions specific to your operating system. If you use Docker you have to do it with your 127.0.0.1 address too
- for mac you can simply use with your wifi network
networksetup -setdnsservers Wi-Fi 127.0.0.1
- for linux you can simply modify the file /etc/resolv.conf
- comment the actual dns server
- add your dns server
nameserver 127.0.0.1
Once you have finished using the server, remember to reset the basic dns server
- for example to use google dns server on mac
networksetup -setdnsservers Wi-Fi 8.8.8.8
you can block domains by adding domain names to those already present or make your own configuration file with your blocked domains
{
"DomainsBlocked": [
"youtube.com",
"twitter.com",
"instagram.com",
"twitch.com",
"twitch.tv",
"linkedin.com",
"tiktok.com"
]
}
- focus
- focus
- host (only for mac)
- To start the DNS server in any mode through the google dns server :
./main {mode} --proxy
- To start the DNS server in focus mode with google proxy (prefered mode to work in focus mode):
./main focus --proxy
- To start the DNS server in focus mode with google proxy and a specify config json file for example config/config.json:
./main focus --file "config/config.json" --proxy
- To start the DNS server in focus mode with only your dns server to resolve Dns request (for example if you want no cache on the domain name resolution)
./main focus
-
To set/reset your dns server configured on your Mac:
-
Set your dns server to 127.0.0.1 and do a backup file with your current dns nameserver
./main host --set
- Use your last backup file to reset your dns server
./main host --reset
- To start the DNS server with docker :
-
make sur to have only 127.0.0.1 on your dns server config, otherwise it might not work even if 127.0.0.1 is specified before the other dns server
-
copy the config file with the docker start command
cp .env.example .env
-
modify DOCKER_APP_COMMAND if you want to use an other command to start your dns-focus
-
start the app in docker
docker compose up --build
Description : DOCKER_APP_COMMAND is useful only to start the program in the docker env, this command will be used to start your golang application
example : DOCKER_APP_COMMAND="./main focus --proxy" start your dns server in docker in focus mode
DNS focus is distributed under the MIT license.