如何配置 BIND 来为地址 app.domain.domain 提供服务

如何配置 BIND 来为地址 app.domain.domain 提供服务

我想要在 app-name.local.dev 上提供 Web 应用程序

目前我已准备好配置,可在 app-name.local 上提供服务

名称配置文件

zone "davinci.local" IN {
    type master;
    file "davinci.local";
};

davinci.local

davinci.local. 7200    IN       SOA     davinci.local. root.davinci.local. (
          20100601 ;    Serial (a date in this case)
          15      ; Refresh every 15 minutes
            3600    ; Retry every hour
            3000000 ; Expire after a month+
            86400 ) ; Minimum ttl of 1 day
              IN      NS      davinci.local.
              IN      A       127.0.0.1
*.davinci.local.        IN      A       127.0.0.1      

为了服务 davinci.local.dev 我必须做哪些改变?

我尝试这个:name.conf

zone "davinci.local.dev" IN {
   type master;
   file "davinci.local.dev";
};

/var/named/davinci.local.dev

davinci.local.dev 7200    IN       SOA     davinci.local.dev. root.davinci.local.dev. (
          20100601 ;    Serial (a date in this case)
          15      ; Refresh every 15 minutes
            3600    ; Retry every hour
            3000000 ; Expire after a month+
            86400 ) ; Minimum ttl of 1 day
              IN      NS      davinci.local.dev
              IN      A       127.0.0.1
*.davinci.local.dev        IN      A       127.0.0.1 

但是我收到此错误:

named-checkzone davinci.local.dev /var/named/davinci.local.dev 
/var/named/davinci.local.dev:1: SOA record not at top of zone (davinci.local.dev.davinci.local.dev)
/var/named/davinci.local.dev:8: using RFC1035 TTL semantics
zone davinci.local.dev/IN: loading from master file /var/named/davinci.local.dev failed: not at top of zone

在 nginx.conf 中:

server {
      listen 8080;
      server_name .davinci.local;
      root /Users/Nerian/NetBeansProjects/DaVinci/DaVinci/public;
      passenger_enabled on;
   }      

server {
      listen 8080;
      server_name .davinci.local.dev;
      root /Users/Nerian/NetBeansProjects/DaVinci/DaVinci/public;
      passenger_enabled on;
   }

答案1

您需要添加另一部分到named.conf:-

zone "davinci.local.dev" IN {
    type master;
    file "davinci.local.dev";
};

然后,复制 的区域文件davinci.local,将所有对 的引用更改为davinci.local.davinci.local.dev.并另存为davinci.local.dev。然后您需要告诉 bind 重新加载其配置 -rndc reloadservice bind reload应该/etc/init.d/bind reload可以工作,具体取决于操作系统。

您还需要对您的网络服务器进行更改 - 大概是另一个虚拟主机。

相关内容