Many Airtel home routers provide DHCP but do not expose a setting for
choosing the DNS server distributed to connected devices.
That creates a problem if you want to run AdGuard Home for the entire
network. You can install AdGuard and manually configure every phone,
laptop, and TV to use it, but that quickly becomes inconvenient.
A cleaner solution is to let AdGuard Home provide both DNS and DHCP,
while the Airtel router continues to provide Wi-Fi, NAT, and internet
access.
This tutorial shows how to build that setup using:
- an Airtel home router
- a Fedora computer
- Docker and Docker Compose
- AdGuard Home
The example network used here is:
Router: 192.xxx.x.1
Fedora: 192.xxx.x.13
Network: 192.xxx.x.0/24
Subnet Mask: 255.255.255.0
DHCP Pool: 192.xxx.x.100 - 192.xxx.x.200
Your Airtel router may use different addresses. Check your own network
before copying the IP addresses in this tutorial.
What We Are Building
The final architecture will look like this:
Internet
│
▼
┌───────────────┐
│ Airtel Router │
│ 192.xxx.x.1 │
│ │
│ Gateway + NAT │
│ DHCP: OFF │
└───────┬───────┘
│
┌─────────────┴─────────────┐
│ │
▼ ▼
┌──────────────────┐ Other Devices
│ Fedora Computer │
│ 192.xxx.x.13 │
│ │
│ AdGuard Home │
│ DNS → Port 53 │
│ DHCP → Port 67 │
└──────────────────┘
The responsibilities are split like this:
Airtel Router
├── Wi-Fi
├── Internet connection
├── Default gateway
└── NAT
Fedora + AdGuard Home
├── DNS
├── DNS filtering
├── DNS caching
└── DHCP
Your normal internet traffic does not pass through the Fedora
computer.
DNS:
Phone → AdGuard → Upstream DNS
Normal internet traffic:
Phone → Airtel Router → Internet
This distinction is important. AdGuard is the DNS and DHCP server, not
the router.
Before You Start
You should already have Docker and Docker Compose available on Fedora.
Verify them:
docker --version
docker compose version
You should also know the name of your active network interface.
Run:
ip link
For this tutorial, the Wi-Fi interface is:
wlo1
You can find your router's address with:
ip route | grep default
For example:
default via 192.xxx.x.1 dev wlo1
Here:
192.xxx.x.1
is the Airtel router.
Step 1: Create the AdGuard Home Docker Compose Project
Create a directory for AdGuard:
mkdir -p ~/Documents/Dev/compose/adguard
cd ~/Documents/Dev/compose/adguard
Create:
compose.yaml
with:
services:
adguardhome:
image: adguard/adguardhome:edge
container_name: adguardhome
restart: unless-stopped
network_mode: host
volumes:
- adguard_work:/opt/adguardhome/work
- adguard_conf:/opt/adguardhome/conf
volumes:
adguard_work:
adguard_conf:
Start it:
docker compose up -d
Check:
docker ps
You should see the adguardhome container running.
Step 2: Why We Use Host Networking
The important line in the Compose file is:
network_mode: host
AdGuard will eventually act as the DHCP server.
DHCP clients initially have no IP configuration, so they use broadcast
packets to discover a DHCP server.
The process is:
Client AdGuard
│ │
│──── DHCP Discover ───────────►│
│ │
│◄──── DHCP Offer ──────────────│
│ │
│──── DHCP Request ────────────►│
│ │
│◄──── DHCP ACK ────────────────│
This is commonly called the DHCP DORA process.
Using host networking lets AdGuard interact directly with Fedora's
physical network interface instead of sitting behind Docker's normal
bridge network.
Do not add a ports: section when using this configuration. With host
networking, AdGuard binds directly to ports on the Fedora host.
Step 3: Complete the Initial AdGuard Setup
Open the AdGuard Home interface in your browser.
Depending on the initial AdGuard setup state, the installation wizard
may initially use another port. Complete the wizard and configure the
final administrative interface to listen locally.
For the finished configuration, use:
Web interface:
127.0.0.1:80
This keeps the administrative dashboard accessible from the Fedora
computer without exposing it unnecessarily to every device on the Wi-Fi.
After configuration, open:
http://127.0.0.1
Step 4: Give the Fedora Computer a Static IP
Before making Fedora the network's DNS and DHCP server, give it a
predictable address.
Find the active NetworkManager connection:
nmcli connection show --active
Copy its UUID.
You may have multiple saved connections with the same Wi-Fi name, so
using the UUID is safer than using the connection name.
For this example, Fedora will use:
192.xxx.x.13/24
Configure it:
sudo nmcli connection modify <CONNECTION-UUID> \
ipv4.method manual \
ipv4.addresses "192.xxx.x.13/24" \
ipv4.gateway "192.xxx.x.1" \
ipv4.dns "127.0.0.1" \
ipv4.ignore-auto-dns yes
Reconnect:
nmcli connection down <CONNECTION-UUID>
nmcli connection up <CONNECTION-UUID>
Verify:
ip addr show wlo1 | grep 'inet '
You should see:
192.xxx.x.13/24
without the dynamic flag.
Check the default route:
ip route | grep default
It should still point to the Airtel router:
default via 192.xxx.x.1 dev wlo1
The Airtel router remains your gateway.
Step 5: Reserve the Fedora Address on the Airtel Router
Open the Airtel router's administration page.
For this network:
http://192.xxx.x.1
Look for a feature named something similar to:
MAC-IP Bind
IP-MAC Binding
Address Reservation
Static Lease
The exact name depends on the Airtel router model and firmware.
Find Fedora's active Wi-Fi MAC address:
ip link show wlo1
Create a binding between that MAC address and:
192.xxx.x.13
This prevents the router from accidentally assigning the server address
to another device.
Be aware that modern Wi-Fi systems may use randomized MAC addresses. Use
the MAC address actually active on the Airtel Wi-Fi connection rather
than assuming the adapter's permanent hardware address is being used.
Step 6: Configure AdGuard's DNS Listeners
AdGuard should listen for DNS requests on:
127.0.0.1
192.xxx.x.13
with DNS port:
53
The purpose of each listener is:
127.0.0.1:53
Fedora itself can use AdGuard.
192.xxx.x.13:53
Other devices on the LAN can use AdGuard.
Keep the dashboard on:
127.0.0.1:80
if you only want it accessible from the Fedora machine.
Restart AdGuard if necessary:
docker restart adguardhome
Verify:
sudo ss -lntup | grep ':53'
You should see AdGuard listening on both:
127.0.0.1:53
192.xxx.x.13:53
Step 7: Do Not Disable systemd-resolved
Fedora normally runs systemd-resolved.
You may see:
127.0.0.53:53
127.0.0.54:53
when checking port 53.
For example:
sudo ss -lntup | grep ':53'
may show:
127.0.0.1:53 AdGuardHome
192.xxx.x.13:53 AdGuardHome
127.0.0.53:53 systemd-resolved
127.0.0.54:53 systemd-resolved
This is valid.
The processes use different IP addresses even though they use the same
port number.
There is no need to disable systemd-resolved.
Step 8: Test AdGuard Locally
Test DNS directly against AdGuard:
dig @127.0.0.1 google.com
Then test the LAN address:
dig @192.xxx.x.13 google.com
Both should return successful DNS responses.
At this point:
Fedora → AdGuard DNS → Upstream DNS
is working.
Do not disable Airtel DHCP yet.
Step 9: Open DNS in Fedora's Firewall
Other LAN devices need permission to reach Fedora on port 53.
Open UDP DNS:
sudo firewall-cmd \
--zone=FedoraWorkstation \
--add-port=53/udp \
--permanent
Open TCP DNS:
sudo firewall-cmd \
--zone=FedoraWorkstation \
--add-port=53/tcp \
--permanent
Reload:
sudo firewall-cmd --reload
Verify:
firewall-cmd --zone=FedoraWorkstation --list-ports
You should see:
53/tcp
53/udp
among the configured ports.
Step 10: Test AdGuard from Another Device
Before changing DHCP, test whether another device can reach AdGuard.
Temporarily configure a phone or another computer to use:
DNS Server:
192.xxx.x.13
Browse normally and check:
AdGuard Home → Query Log
You should see DNS requests from the device.
This proves that LAN DNS works before making the entire network
dependent on it.
Return the test device to automatic DNS afterward if desired. DHCP will
distribute the AdGuard address automatically later.
Step 11: Allow DHCP Through Fedora's Firewall
AdGuard also needs to receive DHCP traffic.
Run:
sudo firewall-cmd \
--zone=FedoraWorkstation \
--add-service=dhcp \
--permanent
Reload:
sudo firewall-cmd --reload
Verify:
firewall-cmd --zone=FedoraWorkstation --list-services
You should see:
dhcp
Do not confuse this with dhcpv6-client, which is a separate service.
Step 12: Configure AdGuard's DHCP Server
Open:
http://127.0.0.1
Go to AdGuard's DHCP settings.
Select the physical Wi-Fi interface:
wlo1 - 192.xxx.x.13
Do not select one of Docker's bridge interfaces.
Configure IPv4 DHCP as:
Gateway: 192.xxx.x.1
Range Start: 192.xxx.x.100
Range End: 192.xxx.x.200
Subnet Mask: 255.255.255.0
Lease: 86400
The pool deliberately does not contain 192.xxx.x.13.
Save the configuration and enable AdGuard's DHCP server.
Verify:
sudo ss -lunp | grep ':67'
A successful configuration should show AdGuardHome listening on UDP
port 67 on wlo1.
For example:
0.0.0.0%wlo1:67
At this point AdGuard is ready to provide DHCP.
Step 13: Disable DHCP on the Airtel Router
Only do this after confirming that AdGuard is listening on port 67.
Open:
http://192.xxx.x.1
Navigate to the Airtel router's LAN/DHCP settings.
A typical Airtel interface may show something similar to:
IP Address: 192.xxx.x.1
Subnet Mask: 255.255.255.0
DHCP Server: Enable
DHCP IP Pool: 192.168.18.2 - 192.168.18.253
DHCP Lease Time: 24 hours
Change:
DHCP Server: Enable
to:
DHCP Server: Disable
Apply the change.
Do not change the router's LAN address.
It should remain:
192.xxx.x.1
because it is still the network's gateway.
Step 14: Reconnect a Client
Take a phone or another computer and make sure its network configuration
is set to:
IP: Automatic / DHCP
DNS: Automatic
Disconnect and reconnect it to the Airtel Wi-Fi.
Then open:
AdGuard Home → DHCP → DHCP Leases
The device should appear as a dynamic lease.
A client should receive something similar to:
IP: 192.xxx.x.105
Gateway: 192.xxx.x.1
DNS: 192.xxx.x.13
The exact IP can be anywhere inside:
192.xxx.x.100 - 192.xxx.x.200
Step 15: Verify DNS Filtering
From Fedora:
dig @192.xxx.x.13 google.com
Then open websites from another connected device and inspect:
AdGuard Home → Query Log
You should see the client's DNS requests.
If you have a domain intentionally blocked through a custom rule, you
can test it directly:
dig @192.xxx.x.13 blocked-example.com
Depending on AdGuard's configured blocking mode, a blocked request may
return 0.0.0.0, NXDOMAIN, or another configured blocking response.
Step 16: Add Blocklists Carefully
AdGuard Home can use DNS blocklists to block advertising, tracking,
telemetry, malicious domains, and other unwanted endpoints.
It is tempting to enable every available list.
Avoid doing that.
Several lists can contain substantial overlap:
List A
├── ads.example.com
├── tracker.example.com
└── telemetry.example.com
List B
├── ads.example.com
├── tracker.example.com
└── another-tracker.example
More rules do not automatically mean better filtering.
Large numbers of overlapping lists can increase:
- memory usage
- update time
- filter reload time
- false positives
- application breakage
- troubleshooting difficulty
Start with a reputable general-purpose filter and add complementary
lists only when you identify a specific gap.
Step 17: Configure Per-Device Policies
Not every device on a home network needs identical filtering.
AdGuard Home can maintain persistent clients and apply different
policies.
For example:
Personal Laptop
└── Standard filtering
Parent Phone
└── Standard filtering
Child Phone
├── Filtering
├── Parental controls
├── Safe Search
└── Restricted services
You can create static DHCP leases for devices that should always receive
predictable addresses.
This provides policy control at the DNS layer without applying parental
restrictions to every person on the network.
Remember that DNS filtering is not equivalent to full network isolation.
Devices using encrypted DNS, hard-coded IP addresses, VPNs, or other
bypass mechanisms may require controls at the router/firewall level.
Step 18: Understand the Query Log
The Query Log is one of AdGuard Home's most useful diagnostic tools.
It shows:
Client
↓
Requested Domain
↓
Allowed / Blocked
↓
Matching Filter
However, a DNS request does not prove that someone intentionally visited
a website.
Applications frequently contact domains in the background for:
- advertising
- analytics
- telemetry
- notifications
- updates
- content delivery
For deeper investigation, combine AdGuard with packet-capture tools such
as Wireshark or PCAPdroid.
A useful mental model is:
AdGuard Query Log
│
└── What DNS name was requested,
and was it blocked?
Wireshark / PCAPdroid
│
└── What network connection
was actually attempted?
Step 19: Observe DHCP with Wireshark
This setup also provides a useful networking exercise.
Start Wireshark on Fedora and capture traffic on:
wlo1
Use the display filter:
dhcp
Disconnect and reconnect another device to Wi-Fi.
You should be able to observe:
DHCP Discover
DHCP Offer
DHCP Request
DHCP ACK
The DHCP process that is normally hidden inside the router is now being
performed by a service running on your own Fedora machine.
For DNS traffic, use:
dns
as the display filter.
Step 20: Remember That Fedora Is Now Infrastructure
Once Airtel DHCP is disabled, the Fedora computer becomes an important
part of the network.
If Fedora:
- shuts down
- sleeps
- disconnects from Wi-Fi
- leaves the house
- stops Docker
- stops the AdGuard container
then new devices may fail to obtain DHCP leases and existing clients may
lose DNS resolution.
The Airtel router can still have a perfectly good internet connection
while devices appear unable to browse.
For experimentation, a laptop is fine.
For a permanent deployment, move AdGuard to an always-on device such as:
- Raspberry Pi
- low-power mini PC
- home server
- dedicated networking appliance
Once family members start asking why the internet stopped when you
rebooted your laptop, the experiment has officially become
infrastructure.
Emergency Recovery
If something goes wrong during the DHCP handover, the fastest recovery
is:
AdGuard DHCP → OFF
Airtel DHCP → ON
Reconnect your devices afterward.
That restores the Airtel router as the DHCP server.
Full Rollback
If you want to return Fedora to normal router-managed networking, first
disable AdGuard DHCP and re-enable DHCP on the Airtel router.
Then restore NetworkManager:
sudo nmcli connection modify <CONNECTION-UUID> \
ipv4.method auto \
ipv4.addresses "" \
ipv4.gateway "" \
ipv4.dns "" \
ipv4.ignore-auto-dns no \
ipv6.dns "" \
ipv6.ignore-auto-dns no
Reconnect:
nmcli connection down <CONNECTION-UUID>
nmcli connection up <CONNECTION-UUID>
Verify:
ip addr show wlo1 | grep 'inet '
You should see an address marked:
dynamic
Check the route:
ip route | grep default
It should resemble:
default via 192.xxx.x.1 dev wlo1 proto dhcp
Check DNS:
resolvectl status wlo1
The router should once again appear as the DNS server, for example:
Current DNS Server: 192.xxx.x.1
Remove the firewall rules added for AdGuard:
sudo firewall-cmd \
--zone=FedoraWorkstation \
--remove-port=53/tcp \
--permanent
sudo firewall-cmd \
--zone=FedoraWorkstation \
--remove-port=53/udp \
--permanent
sudo firewall-cmd \
--zone=FedoraWorkstation \
--remove-service=dhcp \
--permanent
sudo firewall-cmd --reload
If you created a MAC-IP binding for Fedora in the Airtel router, remove
it as well.
You do not have to delete AdGuard.
You can keep the container and its configuration for future use. With
AdGuard DHCP disabled and Fedora returned to router-provided DNS, the
normal network no longer depends on it.
Final Architecture
When everything is enabled, the network is:
Internet
▲
│
Airtel Router
192.xxx.x.1
Gateway + NAT
▲
│
┌─────────────────┼─────────────────┐
│ │ │
Phone TV Laptop
│ │ │
└──────── DNS + DHCP ──────────────┘
│
▼
Fedora Host
192.xxx.x.13
AdGuard Home
DNS + DHCP
The important idea is not simply that AdGuard blocks advertisements.
The setup separates services that consumer routers normally hide inside
one device:
Routing ≠ DHCP ≠ DNS
The Airtel router can remain the internet gateway while another machine
provides DHCP and DNS to the LAN.
That makes AdGuard Home a useful filtering tool, but it also turns a
normal home network into a practical environment for learning how DNS,
DHCP, Linux networking, Docker, firewalls, and client configuration work
together.
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.