Running Nameserver behind NAT

I have an internet connection with a static ip from my ISP. I do have mail servers and webservers hosted from it. What i would like to achieve is run couple of nameservers by getting another static ip from my ISP. I have forwarded TCP and UDP ports from my local IP address and the internet connection is being managed by pfsense. The DNS resolver and forwarder service has been disabled.

I tried to setup a nameserver by NAT and forwarded PORT 53 for udp & tcp traffic. But still when i try to query a record for a zone on my nameserver using dig externally or internally , i get an error "no servers could be reached". Is there any guide or information that would help me to setup the nameservers behind NAT or help me solve this issue?

My ISP has confirmed that they do not have blocks or filters in place. I have also confirmed that no ports are being blocked or filtered from my end too. The name of the nameserver is ns1.sitehosters.in.

ETHERNET CONFIG on NS1

auto eth1
iface eth1 inet static
address 192.168.1.12 
netmask 255.255.255.0 
gateway 192.168.1.1(PFSENSE) 
dns-nameservers 8.8.8.8

/etc/bind/named/conf.options

options {
directory "/var/cache/bind";
dnssec-validation auto;
auth-nxdomain no;
listen-on-v6 { any; };
};

Named.conf.local file on ns1

nano /etc/bind/named.conf.local
zone "sitehosters.in" {
type master;
allow-transfer {none;};
file"/etc/bind/pri.sitehosters.in"
};

Netstat output from below:

tcp 0 0 192.168.1.36:domain . LISTEN 1156/named 
tcp 0 0 localhost:domain . LISTEN 1156/named 
tcp 0 0 localhost:953 . LISTEN 1156/named 
udp 0 0 192.168.1.36:domain . 1156/named 
udp 0 0 localhost:domain . 1156/named

DNSCHECK at PINGDOM

No name servers found at child.

No name servers could be found at the child. 
This usually means that the child is not configured to answer queries about the zone.

Please find some screenshots of my router config which might help you to point me in the right direction. I use pfsense on a PC which is managing all the internet connection and firewall.

When using packet capture on my wan port in pfsense, i get

19:05:02.660753 IP xx.xx.xx.xx.13747 > 8.8.8.8.53: UDP, length 27
19:05:02.669900 IP 8.8.8.8.53 > xx.xx.xx.xx.13747: UDP, length 509
19:05:02.670409 IP xx.xx.xx.xx.63621 > 8.8.8.8.53: UDP, length 44
19:05:02.694125 IP xx.xx.xx.xx.34919 > 8.8.8.8.53: UDP, length 27
19:05:02.704487 IP 8.8.8.8.53 > xx.xx.xx.xx.34919: UDP, length 509
19:05:02.705580 IP xx.xx.xx.xx.11687 > 8.8.8.8.53: UDP, length 44
19:05:02.741893 IP 8.8.8.8.53 > xx.xx.xx.xx.11687: UDP, length 208
19:05:02.741919 IP 8.8.8.8.53 > xx.xx.xx.xx.63621: UDP, length 208

19:13:39.682095 IP 81.143.220.107.51368 > xx.xx.xx.xx.53: tcp 0
19:13:39.682355 IP xx.xx.xx.xx.53 > 81.143.220.107.51368: tcp 0
19:13:39.893583 IP 81.143.220.107.51368 > xx.xx.xx.xx: tcp 0
19:13:39.894893 IP 81.143.220.107.51368 > xx.xx.xx.xx.53: tcp 34
19:13:39.895023 IP xx.xx.xx.xx.53 > 81.143.220.107.51368: tcp 0
19:13:39.895353 IP xx.xx.xx.xx.53 > 81.143.220.107.51368: tcp 155
19:13:40.100199 IP 81.143.220.107.51368 > xx.xx.xx.xx.53: tcp 0
19:13:40.100220 IP 81.143.220.107.51368 > xx.xx.xx.xx.53: tcp 0

The report at intodns.com says

DNS servers responded   ERROR: One or more of your nameservers did not respond:
The ones that did not respond are: xx.xx.xx.xx
0
задан 22 June 2017 в 07:21
2 ответа

Я понял это. У провайдера был фильтр на 53-м порту, хотя он был открыт. Нужно сменить провайдера, так как они не могут снять блокировку. Спасибо всем за время, потраченное на решение проблемы

0
ответ дан 5 December 2019 в 08:00

Если вы хотите запустить сервер имен, который является полномочным органом для зоны Intenet, тогда ему необходимо будет правильно адресовать общедоступный IP-адрес.

Если вы должны поместить сервер имен за NAT, тогда устройство NAT должно включать соответствующий шлюз прикладного уровня (ALG). Хотя многие устройства NAT будут включать в себя ALG, подходящий для NAT для IP-адреса клиента, я не знаю, созданы ли какие-либо из них для записей NAT SOA и т. Д.

Если у вас есть только / 32 общедоступных адреса, вы можете перенести -передайте через внешний маршрутизатор, а затем протолкните его через второе устройство NAT, чтобы восстановить исходный IP-адрес назначения. Наверное, это должно сработать, но я еще не думал об этом подробно.

Я не рассматривал подробно конфигурации yopu, но заметил, что у вас 8.8.8.8 определено как сервер имен. Если вы не хотите ограничить свой сервер имен только авторитетным, тогда вам нужно установить его на 127.0.0.1.

При отражении двойное преобразование NAT не требуется. DNS-серверу может потребоваться интерфейс с общедоступным IP-адресом, однако вы, вероятно, сможете добиться этого с помощью вторичного IP-адреса на интерфейсе.

0
ответ дан 5 December 2019 в 08:00

Теги

Похожие вопросы