Logo

Armand.nz

Home / About / Linkedin / Github

Switch port 3053 to port 53 using Adguard DNS on Gl.inet Routers

#DNS #adguard #gl-inet |

glinet-adguard

If you’re using a Gl.inet router with AdGuard installed, you might encounter an issue where only “localhost” appears in the clients’ list when AdGuard is first activated. This occurs because dnsmasq operates on port 53, while AdGuard defaults to port 3053. To resolve this, you’ll need to switch this port. This workaround, shared in this gl-inet-forum thread, proved effective for me. Here’s a concise summary of the steps I followed:

Backup configuration

I Recommend to create a backup of your router configuration first:

  1. In Luci: System -> Backup/Flash firmware. This will save your settings.

Change dnsmasq and AdGuard ports

The following steps has to be run as root

  1. Check the service dnsmasq running by using netstat command, example below:
netstat -naulp | grep -i dns
  1. Designate another port such as 5300 in the dnsmasq config
#echo "port=5300" >> /etc/dnsmasq.conf
  1. Now we can change the AdGuard port to 53. Open the AdGuard config using a text editor, vi
vi /etc/AdGuardHome/config.yaml
  1. Find the entry in the config that assigns the listening port, and change it from ”port: xxxx” to  “port: 53” e.g:
---
dns: 
  bind_hosts:
    - 0.0.0.0
  port: 53
---
  1. Then restart your Router.

Disable dnsmasq service

  1. Lastly, we can safely disable dnsmasq service, the commands below:
# Stop
/etc/init.d/dnsmasq stop
# Disable start on boot
/etc/init.d/dnsmasq disable

If any issues occur after these changes, we can roll back to the backed-up config either by y restoring them using a backup file or reversing the changes made here

Before Changes: DNS query appears as “localhost” and Client requests appear from localhost 127.0.0.1 (AdGuard port was listening to port 3053)

glinet-adguard-query-before

Before Changes: DNS query appears correct and Client requests appear from Client IP (AdGuard port is now listening to port 53 and dnsmasq is disabled)

glinet-adguard-query-before

comments powered byDisqus

Copyright © Armand