R
R
Rozello2016-03-17 20:11:08
linux
Rozello, 2016-03-17 20:11:08

How to set up a caching DNS server to work with the global network through NAT?

The local network has FreeBSD (192.168.1.10), router (local-192.168.1.1, external-1.1.1.1), desktop (192.168.1.11).
FreeBSD has dnsmasq (config paste2.org/eIJ09NZt ) as the caching dns.
Router forwarded port 53 (UDP&TCP) on FreeBSD(192.168.1.10).
According to the logic of things, dns should have become available from the Internet, but it did not work out.
If you request records by domain by contacting the external ip, you get the following.
From the local network:

$ dig @1.1.1.1 google.com
;; reply from unexpected source: 192.168.1.10#53, expected 1.1.1.1#53
;; reply from unexpected source: 192.168.1.10#53, expected 1.1.1.1#53
;; reply from unexpected source: 192.168.1.10#53, expected 1.1.1.1#53
; <<>> DiG 9.9.5-3ubuntu0.8-Ubuntu <<>> @1.1.1.1 google.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

And this is in the log on the server after this request:
Mar 17 16:32:02 ServerL dnsmasq[33582]: query[A] google.com from 192.168.1.11
Mar 17 16:32:02 ServerL dnsmasq[33582]: forwarded google.com to 8.8.8.8
Mar 17 16:32 :02 ServerL dnsmasq[33582]: reply google.com is 216.58.209.206
Mar 17 16:32:07 ServerL dnsmasq[33582]: query[A] google.com from 192.168.1.11
Mar 17 16:32:07 ServerL dnsmasq[ 33582]: cached google.com is 216.58.209.206
Mar 17 16:32:12 ServerL dnsmasq[33582]: query[A] google.com from 192.168.1.11
Mar 17 16:32:12 ServerL dnsmasq[33582]: cached google .com is 216.58.209.206

From the Internet:
$ dig @1.1.1.1 google.com
; <<>> DiG 9.8.3-P1 <<>> @1.1.1.1 google.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

And the logs are empty.
Actually the question is how to configure all this in such a way that dns would be available from the Internet?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question