Allocating a DNS server to a specific client

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
wbartram
DD-WRT Novice


Joined: 27 Oct 2017
Posts: 14

PostPosted: Fri Sep 24, 2021 9:01    Post subject: Allocating a DNS server to a specific client Reply with quote
Hi

I am using a WRT 1200 ACv2
Using DDWRT build 47381

I am running OpenVPN client with PBR.

I have added this to the Additional Dnsmasq Options

dhcp-host=set:apple,40:CB:C0:C1:A1:84,192.168.2.121
dhcp-option=tag:apple,6,1.1.1.1,1.0.0.1

What I need is 192.168.2.121 to be allocated DNS servers 1.1.1.1 and 1.0.0.1.

This is working - the problem is that all the other clients now also receive this DNS server.

Any help would be very valued THANKS

William
Sponsor
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6410
Location: UK, London, just across the river..

PostPosted: Fri Sep 24, 2021 9:22    Post subject: Reply with quote
try this way, add those to your firewall script

iptables -t nat -I PREROUTING -i br0 -s 192.168.2.121 -p udp --dport 53 -j DNAT --to 1.1.1.1
iptables -t nat -I PREROUTING -i br0 -s 192.168.2.121 -p tcp --dport 53 -j DNAT --to 1.1.1.1

can use them without -i br0 if you have any troubles with it or any other interface IP belongs to...

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55460 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55460 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Fri Sep 24, 2021 9:47    Post subject: Re: Allocating a DNS server to a specific client Reply with quote
wbartram wrote:
Hi

I am using a WRT 1200 ACv2
Using DDWRT build 47381

I am running OpenVPN client with PBR.

I have added this to the Additional Dnsmasq Options

dhcp-host=set:apple,40:CB:C0:C1:A1:84,192.168.2.121
dhcp-option=tag:apple,6,1.1.1.1,1.0.0.1

What I need is 192.168.2.121 to be allocated DNS servers 1.1.1.1 and 1.0.0.1.

This is working - the problem is that all the other clients now also receive this DNS server.

Any help would be very valued THANKS

William


How to do this is described in the DNS problems guide:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686

On first glance it looks sort of OK, the order is different but usually DNSMasq will not care.
To be sure use the syntax as described.

If it is still not working maybe you have put those addresses in static DNS too?

As a test use for Apple 8.8.8.8 and see what is happening

(and yes the alternative approach using firewall redirection is also a viable option and described in the guide Smile )

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
wbartram
DD-WRT Novice


Joined: 27 Oct 2017
Posts: 14

PostPosted: Fri Sep 24, 2021 13:09    Post subject: Reply with quote
Hi

Thanks for the suggestion! I have tried adding to the firewall script as suggested. Interesting it's still the same issue. The DNS server 1.1.1.1 is showing up as DNS 0 in the WAN status page. All the other IP addresses are being served this DNS.

As you know I only need 121 to be served this DNS.

Might you have any other suggestions please? THANKS William

UPDATE

OK so I have removed all reference to DNS 1.1.1.1 in the DDWRT setup. But it is still showing up as DNS 0, the only thing i can think is that the router is taking the DNS from the pushed server.confg file in openvpn. Interestingly it seams to be using this DNS for all connections!
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Fri Sep 24, 2021 13:45    Post subject: Reply with quote
To make sure it is not coming from ISP, enable / tick 'Ignore WAN DNS' on setup page.

A Vpn server can push dns servers and almost all commercial vpn providers do.

You can see on the status page if this is happening.
Post a picture of Openvpn setup page and content of additional config and picture of openvpn status page.

Pictures no more than 768 pixels width.

P.S. you do need to setup at least one publicly available dns server on static DNS.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087


Last edited by egc on Mon Sep 27, 2021 10:35; edited 1 time in total
wbartram
DD-WRT Novice


Joined: 27 Oct 2017
Posts: 14

PostPosted: Mon Sep 27, 2021 9:55    Post subject: Allocating a DNS server to a specific client - Update Reply with quote
Hi

Here are the pictures as requested.

THANKS

William
wbartram
DD-WRT Novice


Joined: 27 Oct 2017
Posts: 14

PostPosted: Mon Sep 27, 2021 9:56    Post subject: Reply with quote
and the OPENVPN pushed servers
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Mon Sep 27, 2021 10:47    Post subject: Reply with quote
Please resize your pictures to no more that 768 pixels width (as requested and outlined in the forum guidelines: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087 ) our ancient forum software cannot cope with wider pictures

So your VPN server is indeed pushing DNS servers, for solutions see the DNS problems guide: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686 page 3, pull filter .....

Alternatively use no-resolv see page 2

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum