DNS Proxy/Cache forward to local host

DNS Proxy/Cache forward to local host

DNS Proxy/Cache forward to local host
DNS Proxy/Cache forward to local host
2024-09-30 08:58:51
Tags: #DNS
Model: ER8411  
Hardware Version: V1
Firmware Version: 1.2.2

Hello,

I'm not really satisfied with the current DNS feature set and lack of customization of DNS Proxy/cache so I'm exploring different solutions.

As I would deploy a local DNS server, would it be possible to use the DNS proxy feature to redirect all queries directed to GW to a specific local DNS server? 

My target is to avoid to manually configure or change the DNS server in DHCP, I would like devices to always get the ER8411 as DNS server and let it forward to upstream (local).

Eventually, would it be possible to NAT masquerade all DNS requests in LANs, redirecting all port 53 to a local host? I was using this setup on pfSense to enforce the use of my custom/local DNS even if CPEs had hardcoded DNS configuration.

Thank you.  

  0      
  0      
#1
Options
7 Reply
Re:DNS Proxy/Cache forward to local host
2024-09-30 11:03:15 - last edited 2024-09-30 11:25:41

Trying to setup a NAT rule to forward all traffic :53 to a specific local host but seems to not be possible on the current Omada configuration.

Please allow to set an internal port/VLAN in NAT configuration:

 

Target configuration:

https://psychogun.github.io/docs/opnsense/Redirect-DNS-to-internal-DNS/

  0  
  0  
#2
Options
Re:DNS Proxy/Cache forward to local host
2024-10-04 04:11:50

Hi  @Bianco8 

Any proof screenshots to verify this behavior you've reported?

Config as well.

Best Regards! If you are new to the forum, please read: Howto - A Guide to Use Forum Effectively. Read Before You Post. Look for a model? Search your model NOW Official and Beta firmware. NEW features! Subscribe for the latest update!Download Beta Here☚ ☛ ★ Configuration Guide ★ ☚ ☛ ★ Knowledge Base ★ ☚ ☛ ★ Troubleshooting ★ ☚ ● Be kind and nice. ● Stay on the topic. ● Post details. ● Search first. ● Please don't take it for granted. ● No email confidentiality should be violated. ● S/N, MAC, and your true public IP should be mosaiced.
  1  
  1  
#3
Options
Re:DNS Proxy/Cache forward to local host
2024-10-04 07:54:51 - last edited 2024-10-04 07:55:34

  @Clive_A 

Here's the screenshot. The ports available are the only ones set as WAN, not LAN/internal VLANs.

Please do note I found a way to let the ER8411 to proxy DNS requests internally, even if not officially implemented. DNS Proxy > DNSSEC > Forward to internal IP address > Bogus Replies = Pass .

 

 

  0  
  0  
#4
Options
Re:DNS Proxy/Cache forward to local host
2024-10-06 02:39:27

Hi  @Bianco8 

You wanna port forward a local DNS server and use it as if it's a public IP, and ultimately achieving the forward to this public IP for all upstream queries from the router? 
Is this what you want? 
Would love to hear from you with more details. 

Best Regards! If you are new to the forum, please read: Howto - A Guide to Use Forum Effectively. Read Before You Post. Look for a model? Search your model NOW Official and Beta firmware. NEW features! Subscribe for the latest update!Download Beta Here☚ ☛ ★ Configuration Guide ★ ☚ ☛ ★ Knowledge Base ★ ☚ ☛ ★ Troubleshooting ★ ☚ ● Be kind and nice. ● Stay on the topic. ● Post details. ● Search first. ● Please don't take it for granted. ● No email confidentiality should be violated. ● S/N, MAC, and your true public IP should be mosaiced.
  0  
  0  
#5
Options
Re:DNS Proxy/Cache forward to local host
2024-10-07 09:27:46

Hello  @Clive_A ,

No, I want to perform internal NAT translation to enforce traffic (in my case TCP/UDP on port 53 or else).

The target is:

 

- Device performs traffic to DST-IP any, port 53

- GW receives this traffic

- GW performs internal NAT of traffic port 53, by replacing the DST-IP to a chosen one (internal/external). 

 

You can see a similar setup configured on OPNsense here: https[dot]//homenetworkguy[dot]com/how-to/redirect-all-dns-requests-to-local-dns-resolver/ .

In this way, the DNS in LAN/VLAN is enforced.

No device can perform traffic (in this case DNS) to a different/external IP address and this is transparent to the device itself.

At DNS level, the device querying for a DNS lookup will always get the DNS reply and it will get it from the expected source, but actually the GW is performing internal NAT so the query is forwarded to the configured upstream/IP.

 

With this setup, there is no need of firewall ACL to block traffic (again, ex. DNS port 53) on any IP besides the enforced one. There is no breakage as any client will be able to query any IP but will be actually replied by the configured IP, transparently.

  0  
  0  
#6
Options
Re:DNS Proxy/Cache forward to local host
2024-10-08 01:33:09 - last edited 2024-10-08 02:38:49

Hi @Bianco8 

Thanks for posting in our business forum.

Bianco8 wrote

Hello  @Clive_A ,

No, I want to perform internal NAT translation to enforce traffic (in my case TCP/UDP on port 53 or else).

The target is:

 

- Device performs traffic to DST-IP any, port 53

- GW receives this traffic

- GW performs internal NAT of traffic port 53, by replacing the DST-IP to a chosen one (internal/external). 

 

You can see a similar setup configured on OPNsense here: https[dot]//homenetworkguy[dot]com/how-to/redirect-all-dns-requests-to-local-dns-resolver/ .

In this way, the DNS in LAN/VLAN is enforced.

No device can perform traffic (in this case DNS) to a different/external IP address and this is transparent to the device itself.

At DNS level, the device querying for a DNS lookup will always get the DNS reply and it will get it from the expected source, but actually the GW is performing internal NAT so the query is forwarded to the configured upstream/IP.

 

With this setup, there is no need of firewall ACL to block traffic (again, ex. DNS port 53) on any IP besides the enforced one. There is no breakage as any client will be able to query any IP but will be actually replied by the configured IP, transparently.

I reviewed the whole thing, I don't think we can do it. Simple answer is no.

 

We are not the OPNsense or any of the open-source platforms where you can have a versatile firewall or NAT rules. But forwarding the query to the local DNS server should be a function we already support as you can specify the DNS server internally in (V)LAN.

 

In any case, simply put the DNS IP in the most convenient way to do it. I read the article you shared but you still gonna repeat the same step afterward when you create new interfaces.

 

And most importantly, what the guide sets is to force all the DNS resolution to the router itself. It still gonna leak anyway because the router queries the domains if it cannot resolve it. Upstream server is needed.

 

It is a basic config for the IPtables to forward everything locally to 127.0.0.1 which is the router.

The router still needs an upstream server. Do you verify that it can set a local IP in the upstream and resolve everything correctly?

Best Regards! If you are new to the forum, please read: Howto - A Guide to Use Forum Effectively. Read Before You Post. Look for a model? Search your model NOW Official and Beta firmware. NEW features! Subscribe for the latest update!Download Beta Here☚ ☛ ★ Configuration Guide ★ ☚ ☛ ★ Knowledge Base ★ ☚ ☛ ★ Troubleshooting ★ ☚ ● Be kind and nice. ● Stay on the topic. ● Post details. ● Search first. ● Please don't take it for granted. ● No email confidentiality should be violated. ● S/N, MAC, and your true public IP should be mosaiced.
  0  
  0  
#7
Options
Re:DNS Proxy/Cache forward to local host
2024-10-08 07:22:35

Hello  @Clive_A ,

 

My point in raising this thread is to forward you a suggest/improvement for the Omada gateway platform, not a critic.

Of course, I can set DNS to clients via DHCP or manually set it. The point here is different and partly covered by a workaround:

- Setting DNS on DHCP does not guarantee that devices will stick to it. Devices might use hardcoded IPs.

- If I can choose secure internet upstreams in DNS Proxy, I would expect the ability to specificy a plain internal DNS upstream in DNS Proxy (NOT at endpoint/DHCP level). At the moment custom DNSs can be set only on WAN connections.

- With this setup, I can have the DNS server in VLAN 1 and DNS Proxy forwards all queries from any VLAN with destination ER8411 (in any VLAN) to my DNS.

 

 

My current setup, to bypass these limits is:

 

Devices in VLAN1 Management/VLAN2 Guest/VLAN3 IOT/VLAN4 Operations ---> DNS pointing to GW 192.168.1/2/3/4.1 ---> GW forwards queries via DNS Proxy to DNS Server in VLAN 1.

 

This is also the standard behavior for DNS Proxy. What I luckily found is that I can set a private IP address (I can set any IP I prefer), in DNS Proxy with DNSSEC (Bogus reply = PASS). I don't think this feature was expected, but with this setup I can let the ER8411 to forward to DNS (from any VLAN), to a specific plain DNS server (again, in 1 specific management VLAN). 

 

 

  0  
  0  
#8
Options

Information

Helpful: 0

Views: 291

Replies: 7

Tags

Related Articles