я создал сервер DNS с bind9, и все в порядке в сервере. я могу проверить с помощью ping-запросов свой domin, и я могу вырыть его. но вне моего vps, domin имя не имеет никакого сервера имен.
я использую эту команду
dig @89.42.210.210 fdoc.ir
выройте вывод команды в сервере
; <<>> DiG 9.10.3-P4-Ubuntu <<>> @89.42.210.210 fdoc.ir
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4257
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL:
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;fdoc.ir. IN A
;; ANSWER SECTION:
fdoc.ir. 10800 IN A 89.42.210.210
;; AUTHORITY SECTION:
fdoc.ir. 10800 IN NS ns2.fdoc.ir.
fdoc.ir. 10800 IN NS ns1.fdoc.ir.
;; ADDITIONAL SECTION:
ns1.fdoc.ir. 10800 IN A 89.42.210.210
ns2.fdoc.ir. 10800 IN A 89.42.210.210
;; Query time: 0 msec
;; SERVER: 89.42.210.210#53(89.42.210.210)
;; WHEN: Thu Feb 22 16:03:36 EST 2018
;; MSG SIZE rcvd: 120
выройте вывод команды вне сервера
; <<>> DiG 9.10.3-P4-Ubuntu <<>> @89.42.210.210 fdoc.ir
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 48479
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;fdoc.ir. IN A
;; Query time: 180 msec
;; SERVER: 89.42.210.210#53(89.42.210.210)
;; WHEN: Fri Feb 23 00:33:22 +0330 2018
;; MSG SIZE rcvd: 36
конфигурация nginx
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
server {
listen 80;
listen [::]:80;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/fdoc.ir/html/public;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name fdoc.ir www.fdoc.ir;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
# fastcgi_pass unix:/run/php/php7.0-fpm.sock;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
/etc/hosts
127.0.0.1 localhost
127.0.1.1 ubuntu
89.42.210.210 fdoc.ir www.fdoc.ir
Возможно, есть два преступника.
Сначала убедитесь, что ваш сервер связываний прослушивает внешний IP-адрес или любой другой IP-адрес (0.0.0.0), например, в /etc/bind/named.conf.options
что-то вроде
listen-on port 53 { any; }
Второй и более вероятный вариант. это проверка ваших правил iptables, чтобы они позволяли входить UDP-трафику на порт 53. Если вы запустите iptables -L -n
, он должен иметь что-то вроде
Chain INPUT (policy DROP)
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53
. Если нет, вы можете временно добавить такое правило выполняя от имени root
iptables -I INPUT -p udp --dport 53 -j ACCEPT
Конечно, любой другой брандмауэр между вашим сервером и Интернетом также может блокировать трафик.
благодарность за справку, но проблему решила его, была проблема в
/etc/named.conf.local
//include "/etc/bind/zones.rfc1918";
и просто некомментарий выше строки и каждой вещи работает, как должен.