How to run our own Smart DNS to bypass geo restrictions

0- clone the project and give it a star :)

git clone https://github.com/maj0rmil4d/maj0rdns/

1- build the docker image, so you could use the docker image and its context in the future easily.

docker build -t maj0rdns:latest .

build it

2- Now run the mentioned docker in the previous step.

docker run -d -it — cap-add=NET_ADMIN -p 53:53/udp -p 443:443 -p 80:80 -e IP=PublicIpOfContainer maj0rdns:latest

run it

3- Now the docker will be running in the background, so we could use it by changing the main dns configuration file and add the public IP address of the container to the resolve.conf file.

echo “” > /etc/resolv.conf && echo “nameserver Public_IP_Of_Container” >> /etc/resolv.conf

4- To be sure that everything works correctly, use the following command on your local system.

curl api.myip.com

verify it

5- If you saw your public IP address of the container, it’s time to restart everything in order to make sure:

./restart.sh

6- For example, with running iraccess.sh file the Service will be limited to Iran IP addresses:

./iraccess.sh

1- At first, initialize the swarm, swarm mode :

docker swarm init

2- Now create docker swarm service with the following command:

docker service create — cap-add=NET_ADMIN -p 53:53/udp -p 443:443 -p 80:80 -e IP=PublicIpOfContainer — name maj0rdnscontainer maj0rdns:latest

making a service

3- You could scale the service to 5 docker containers:

docker service scale maj0rdnscontainer=5

scaling it

4- It’s necessary to verify that the previous steps are working correctly and that all of them are running.

docker service ls && docker service ps maj0rdnscontainer

5- You can see the logs by the following command :

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store