virtualmin - настройка частного сервера имен на VPS

Я пытаюсь настроить свои собственные серверы имен, такие как ns1.example.com, на моем VPS

Я уже настроил серверы имен своего домена в Namecheap.com (ns1 и ns2, указывая на IP-адрес моего VPS). Кажется, я не могу заставить его работать. При открытии example.com ничего не отображается:

$ curl example.com
curl: (7) Failed to connect to example.com port 80: No route to host

Обратите внимание, что Apache работает нормально, так как я могу открыть его с помощью IP-адреса VPS. Вот моя конфигурация сервера

/ etc / hostname

ns1

/ etc / hosts

127.0.0.1   localhost.localdomain localhost
172.31.1.100    ns1.example.com ns1
172.31.1.100    ns2.example.com ns2

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
2a01:4f8:c17:1eeb::2  ns1.example.com ns1
2a01:4f8:c17:1eeb::2  ns2.example.com ns2

/etc/bind/ named.conf

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

/etc/bind/ named.conf.options

options {
    directory "/var/cache/bind";
    recursion no;
    allow-transfer { none; };

    dnssec-validation auto;

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 {
        any;
        };
};

/ etc / bind / named.conf.local

zone "example.com" {
    type master;
    file "/var/lib/bind/example.com.hosts";
    allow-transfer {
        127.0.0.1;
        localnets;
        172.31.1.100;
        };
    };

/etc/bind/ named.conf. зоны по умолчанию;

zone "." {
    type hint;
    file "/etc/bind/db.root";
};

zone "localhost" {
    type master;
    file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
    type master;
    file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
    type master;
    file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
    type master;
    file "/etc/bind/db.255";
};

/var/lib/bind/example.com.hosts

$ttl 38400
@   IN  SOA example.com. root.example.com. (
            1486054499
            10800
            3600
            604800
            38400 )
example.com.        IN  NS  ns1.example.com.
example.com.        IN  NS  ns2.example.com.
ns1.example.com.    IN  A   172.31.1.100
ns2.example.com.    IN  A   172.31.1.100
example.com.        IN  A   172.31.1.100
www.example.com.    IN  A   172.31.1.100
ftp.example.com.    IN  A   172.31.1.100
m.example.com.      IN  A   172.31.1.100
localhost.example.com.  IN  A   127.0.0.1
mail.example.com.   IN  A   172.31.1.100
example.com.        IN  MX  5 mail.example.com.
example.com.        IN  TXT "v=spf1 a mx a:example.com ip4:172.31.1.100 ip6:2a01:4f8:c17:1eeb::2 ?all"
0
задан 3 February 2017 в 08:21
1 ответ

Благодаря Майклу Хэмптону

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

Сменил все частные IP-адреса на свой общедоступный IP-адрес VPS, и все работает нормально сейчас.

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

Теги

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