AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[ddns](server)

Martin Hope
dom
Asked: 2021-12-11 01:01:29 +0800 CST

ISC DHCP/DDNS 设置:非 dhcp 客户端的静态条目

  • 0

我已经建立了一个带有 ISC BIND9 和 DHCP 服务的本地网络。新租约触发 DHCP 添加一个完美运行的 A 和 PTR 记录。

我还在dhcpd.conf. 现在我注意到 DDNS 更新仅适用于实际从 DHCP 服务器请求租约的客户端。我在网络中有一些不支持 DHCP 的设备。我仍然在dhcp.conf. 对于那些,不请求租约,现在不创建 DNS 记录。我必须以创建 DNS 记录的方式添加这些静态条目?

如果可能的话,我宁愿只使用dhcpd.conf。非常感谢任何建议!

internal-dns bind ddns isc-dhcp dhcp-server
  • 1 个回答
  • 109 Views
Martin Hope
Henri Gehrt
Asked: 2021-05-26 01:35:44 +0800 CST

Bind9 拒绝来自 nsupdate 的密钥

  • 0

我有一个 Bind9 DNS 服务器正在运行(并且正在运行!)。所有区域都是手动管理的。我现在想更改要自动更新的区域。设置好之后,我尝试了 nsupdate,但它因“拒绝”而失败。我不知道为什么会这样。

配置:rndc.key 包含在 named.conf 中

// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

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

我还在我的 named.conf.local 中添加了允许更新语句,并确保区域文件在/var/lib/bind

root@ns1:/etc/bind# cat named.conf.local
zone "somedomain.com" {
        type master;
        file "/var/lib/bind/db.somedomain.com";
        #update-policy {grant "rndc.key" zonesub ANY;} ;
        allow-update { key rndc.key;};
        allow-transfer { some IP; };
};

密钥存在:

root@ns1:/etc/bind# cat rndc.key
key "rndc-key" {
        algorithm hmac-md5;
        secret "<secret>";
};

但是当我尝试从 localhost 更新 vie nsupdate 时,它​​会拒绝它。

root@ns1:/etc/bind# nsupdate
> server localhost
> key rndc-key <secret>
> zone somedomain.com
> update add test.somedomain.com. 600 IN A someIP
> send
update failed: REFUSED

syslog 对我也没有多大帮助

May 24 22:37:20 ns1 named[30755]: client @0x7f1f8c0e3840 127.0.0.1#27482/key rndc-key: signer "rndc-key" denied
May 24 22:37:20 ns1 named[30755]: client @0x7f1f8c0e3840 127.0.0.1#27482/key rndc-key: update 'somedomain.com/IN' denied
May 24 22:38:09 ns1 named[30755]: resolver priming query complete
May 24 22:38:38 ns1 named[30755]: resolver priming query complete

我复制并粘贴了密钥,所以应该没有错字。这些都是原始终端输出,只是更改了域和 IP。

domain-name-system bind ddns dynamic-dns nsupdate
  • 1 个回答
  • 943 Views
Martin Hope
lb-99
Asked: 2021-03-23 11:52:36 +0800 CST

Windows AD 未在混合集成中更新 Linux DDNS

  • 0

我正在使用 Linux DDNS 设置设置 Windows AD 服务器。Linux DDNS 按预期运行得非常好。但是,当我尝试将 AD 角色添加到 Windows Enterprise 2019 服务器时,该角色会按预期安装,但不会使用该区域的 SRV 记录更新主 DNS 数据库。

在 Wireshark 中,在 Windows AD 设置期间和之后,我可以看到对 SRV 记录的主 DNS 查询,主 DNS 以“没有这样的名称”响应。

我已允许在主 DNS 上的 named.conf.local 中更新/查询 AD 服务器,并且 AD 服务器设置为使用主 DNS 服务器的地址作为其 DNS 服务器。

我现在已经尝试了两次全新安装 AD 服务器,每次都遇到相同的问题。我不知道可能是什么问题 - 一个潜在的解决方案是否只是手动将所有必要的 SRV 记录添加到数据库文件中?

我在下面添加了配置(我知道允许地址授予太多权限,named.conf.local但我只是在试验并试图让它工作,因为这是我第一次设置它)。

/etc/bind/named.conf.local

zone "lims.co.uk" {
        type master;
        file "/var/lib/bind/db.lims.co.uk";
        notify yes;
        allow-update {
                192.168.80.3;
                192.168.80.7;
                192.168.80.8;
                192.168.80.9;
                localnets;
        };
        allow-query {
                127.0.0.1;
                192.168.80.3;
                192.168.80.5;
                192.168.80.6;
                192.168.80.7;
                192.168.80.8;
                192.168.80.9;
                localnets;
        };
        allow-transfer {
                192.168.80.3;
                192.168.80.5;
                192.168.80.6;
                192.168.80.7;
                192.168.80.8;
                192.168.80.9;
        };
};

zone "80.168.192.in-addr.arpa" {
        type master;
        file "/var/lib/bind/db.80.168.192.in-addr.arpa";
        notify yes;
        allow-update {
                192.168.80.3;
                192.168.80.7;
                192.168.80.8;
                192.168.80.9;
                localnets;
        };
        allow-query {
                127.0.0.1;
                192.168.80.3;
                192.168.80.5;
                192.168.80.6;
                192.168.80.7;
                192.168.80.8;
                192.168.80.9;
                localnets;
        };
        allow-transfer {
                192.168.80.3;
                192.168.80.5;
                192.168.80.6;
                192.168.80.7;
                192.168.80.8;
                192.168.80.9;
        };
};

/var/lib/bind/db.lims.co.uk

$ORIGIN .
$TTL 604800     ; 1 week
lims.co.uk              IN SOA  lims.co.uk. admin\@lims.co.uk. (
                                2021032201 ; serial
                                604800     ; refresh (1 week)
                                86400      ; retry (1 day)
                                2419200    ; expire (4 weeks)
                                604800     ; minimum (1 week)
                                )
                        NS      ns1.lims.co.uk.
                        NS      ns2.lims.co.uk.
                        A       192.168.80.7
                        A       192.168.80.8
                        A       192.168.80.9
$ORIGIN lims.co.uk.
AD1                     A       192.168.80.7
BDC1                    A       192.168.80.8
BDC2                    A       192.168.80.9
ns1                     A       192.168.80.5
ns2                     A       192.168.80.6
dhcp                    A       192.168.80.3

db.80.168.192.in-addr.arpa

$ORIGIN .
$TTL 604800     ; 1 week
80.168.192.in-addr.arpa IN SOA  80.168.192.in-addr.arpa. admin\@lims.co.uk. (
                                2021032201 ; serial
                                604800     ; refresh (1 week)
                                86400      ; retry (1 day)
                                2419200    ; expire (4 weeks)
                                604800     ; minimum (1 week)
                                )
                        NS      ns1.lims.co.uk.
                        NS      ns2.lims.co.uk.
$ORIGIN 80.168.192.in-addr.arpa.
3                       PTR     dhcp.lims.co.uk.
5                       PTR     ns1.lims.co.uk.
6                       PTR     ns2.lims.co.uk.
7                       PTR     AD1.lims.co.uk.
8                       PTR     BDC1.lims.co.uk.
9                       PTR     BDC2.lims.co.uk.
$TTL 300        ; 5 minutes
99                      PTR     DESKTOP-9MFAP8Q.lims.co.uk.

192.168.80.3 DHCP

192.168.80.4 主 DNS

192.168.80.5 辅助 DNS

192.168.80.6 辅助 DNS

192.168.80.7 Windows 广告

192.168.80.8 备份域控制器(尚未配置)

192.168.80.9 备份域控制器(尚未配置)

更新:

我在我的 AD 服务器上收到以下错误。

DFS 复制服务未能联系域控制器以访问配置信息。复制停止。该服务将在下一个配置轮询周期内再次尝试,该周期将在 60 分钟后发生。此事件可能由 TCP/IP 连接、防火墙、Active Directory 域服务或 DNS 问题引起。

附加信息:错误:160(一个或多个参数不正确。)

此计算机现在托管指定的目录实例,但 Active Directory Web 服务无法为其提供服务。Active Directory Web 服务将定期重试此操作。

目录实例:NTDS 目录实例 LDAP 端口:389 目录实例 SSL 端口:636

active-directory bind ddns windows-server-2019 isc-dhcp
  • 1 个回答
  • 109 Views
Martin Hope
Garet Jax
Asked: 2021-03-10 17:38:32 +0800 CST

如何通过 DDNS 转发 www 子域并使用域的证书?- Ubuntu Nginx 让我们加密 DDNS

  • 0

我想我错过了一些简单的东西,但我就是看不到它。

我在运行 Ubuntu 20.04 版本 2 的家用机器上运行最新的 Nginx。我将 pfsense 作为我的路由器/防火墙在另一台机器上运行。我已经设置了一个 DDNS ([my_name].ddns.net) 条目来指向我不断变化的 WAN IP 地址。

我有一个域名“[my_name].net”。我已经能够在我的 Ubuntu/Nginx 机器上为两个域创建 Let's Encrypt 证书:[my_name].net 和 [my_name].ddns.net。

我在托管我的域的站点上创建了一个 CNAME 记录,将“www”映射到“[my_name].ddns.net”。

当我访问 https://[my_name].ddns.net 时,该网站完美出现。

当我访问 https://www.[my_name].net 时,该网站会出现证书警告,因为它正在提取 https://[my_name].ddns.net 的证书。

www.[my_name].net 网站的 nginx 配置为:

server {
    listen 80;

    root /var/www/html;

    index index.html

    server_name www.[my_name].net;

    location / {
            try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.4-fpm.sock;
    }
}

server {
    root /var/www/html;

    index index.html

    server_name www.[my_name].net;

    location / {
            # First attempt to serve request as file, then
            # as directory, then fall back to displaying a 404.
            try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.4-fpm.sock;
    }

    listen 443 ssl;

    ssl_certificate /etc/letsencrypt/live/www.[my_name].net/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/www.[my_name].net/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

我该怎么做才能让 Nginx 将重定向的 URL “看到”为 www.[my_name].net 而不是 [my_name].ddns.net?

谢谢一堆。

certificate domain nginx ddns
  • 1 个回答
  • 51 Views
Martin Hope
lb-99
Asked: 2021-02-24 13:35:17 +0800 CST

无法添加转发映射 SERVFAIL/REFUSED DDNS

  • 0

我在主 dns 服务器上使用 bind9,两个辅助 dns 服务器处于主/从关系。我正在尝试实现 DDNS,但在添加转发映射时似乎遇到了问题,我收到了错误

无法将 DESKTOP-9MFAP8Q.student.co.uk 的正向映射添加到 192.168.80.51:SERVFAIL

我最初得到一个 REFUSED 错误,直到我将 DHCP 服务器的地址添加到主 dns 上的allow-query和allow-transfer选项中。named.conf.local我不确定这是否需要,这只是我为了让它工作而尝试的东西。

我尝试使用更改区域文件的权限

sudo chown 绑定:绑定 /etc/bind/*.db

sudo chmod 664 /etc/bind/*.db

但这对结果没有任何改变。

我将在下面发布配置文件,不胜感激。

路由器 - 192.168.80.2

DHCP - 192.168.80.3

主 DNS - 192.168.80.4

辅助 DNS - 192.168.80.5、192.168.80.6

-------------------------主 DNS------------------------ --

命名.conf.local

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

key "rndc-key" {
        algorithm hmac-sha256;
        secret "ppxPx1DgcHkDWDgngLNlgKAETBPEEL9+k8kn9zI/iKRHMdP/8G+U4FRasufyNGOKuUGgTfNqHnOyFxs3zuWlMA==";
};

zone "student.co.uk" {
        type master;
        file "/etc/bind/db.student.co.uk";
        notify no;
        allow-query {
                127.0.0.1;
                192.168.80.5;
                192.168.80.6;
                192.168.80.3;
        };
        allow-transfer {
                192.168.80.5;
                192.168.80.6;
                192.168.80.3;
        };
        allow-update {
                { key rndc-key; };
        };
};

zone "80.168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/db.80.168.192.in-addr.arpa";
        notify no;
        allow-query {
                127.0.0.1;
                192.168.80.5;
                192.168.80.6;
        };
        allow-transfer {
                192.168.80.5;
                192.168.80.6;
        };
        allow-update {
                { key rndc-key; };
        };
};

命名.conf.options

options {
        directory "/var/cache/bind";

        // If there is a firewall between you and nameservers you want
        // to talk to, you may need to fix the firewall to allow multiple
        // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

         forwarders {
                8.8.8.8;
                8.8.4.4;
         };
         allow-query {
                192.168.80.5;
                192.168.80.6;
                127.0.0.1;
         };
         allow-transfer {
                192.168.80.5;
                192.168.80.6;
                127.0.0.1;
         };

        //========================================================================
        // If BIND logs error messages about the root key being expired,
        // you will need to update your keys.  See https://www.isc.org/bind-keys
        //========================================================================
        dnssec-validation auto;

        listen-on-v6 { any; };
};

db.80.168.192.in-addr.arpa


; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                     2021020902         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns1.student.co.uk.
@       IN      NS      ns2.student.co.uk.
150     IN      PTR     www.student.co.uk.
151     IN      PTR     www.student.co.uk.

db.student.co.uk


; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                     2021021902         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns1.student.co.uk.
@       IN      NS      ns2.student.co.uk.
ns1     IN      A       192.168.80.5
ns2     IN      A       192.168.80.6
www     IN      A       192.168.80.150
www     IN      A       192.168.80.151

-------------------------DHCP------------------------ -

dhcpd.conf

# option definitions common to all supported networks...
option domain-name "student.co.uk";
option domain-name-servers 192.168.80.5, 192.168.80.6;

default-lease-time 600;
max-lease-time 7200;

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-updates on;
ddns-update-style standard;
update-static-leases on;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;

allow unknown-clients;
use-host-decl-names on;

key rndc-key {
        algorithm hmac-sha256;
        secret ppxPx1DgcHkDWDgngLNlgKAETBPEEL9+k8kn9zI/iKRHMdP/8G+U4FRasufyNGOKuUGgTfNqHnOyFxs3zuWlMA==;
};

zone student.co.uk. {
    primary 192.168.80.4;
    key rndc-key;
}

zone 80.168.192.in-addr.arpa. {
    primary 192.168.80.4;
    key rndc-key;
}

subnet 192.168.80.0 netmask 255.255.255.0 {
  range 192.168.80.50 192.168.80.100;
  option domain-name-servers 192.168.80.5, 192.168.80.6;
  option domain-name "student.co.uk";
  ddns-domainname "student.co.uk.";
   ddns-rev-domainname "in-addr.arpa.";
  option subnet-mask 255.255.255.0;
  option routers 192.168.80.2;
  option broadcast-address 192.168.80.255;
  default-lease-time 600;
  max-lease-time 7200;

  host DOMAIN1 {
    hardware ethernet 00:0c:29:20:87:b0;
    fixed-address 192.168.80.99;
    ddns-hostname "test";
  }
}
domain-name-system bind ddns isc-dhcp dhcp-server
  • 1 个回答
  • 3231 Views
Martin Hope
spookypeanut
Asked: 2020-05-24 11:55:55 +0800 CST

通过托管子域访问家庭网络机器

  • 0

我希望能够使用我的外部托管网站的子域来访问我家庭网络上机器的特定端口。例如,假设我的域是example.com,我希望能够与homebox.example.com我的家庭网络上名为homebox.

目前,我最好的解决方案是在我的外部托管网站上创建一个转发页面,该页面转发到一个 ddns 页面(使用例如duckdns,尽管我仍然需要研究哪个是最好的解决方案),然后将其传递到特定端口我的路由器,我很乐意将其配置为转发到内部机器(我对指定端口号并不挑剔:我很乐意使用homebox.example.com:1234或任何工作)。但是这个解决方案似乎一步太多了,我觉得前锋不应该是必要的。我什至不确定它是否会起作用,因为这不会是网络流量。有没有更简单、更强大的解决方案?

我在这种事情上非常n00b,所以所有的建议都非常感激!

subdomain port-forwarding ddns
  • 1 个回答
  • 73 Views
Martin Hope
treegor
Asked: 2020-04-01 06:59:00 +0800 CST

Bind 9 和 Samba 4 中的 in-addr.arpa 区域委托作为具有 DDNS 的 AD DC

  • 3

环境和目标

在我的测试 KVM 实验室中,我有一个虚拟网络172.16.50/24,在这个网络中,我有 2 个运行 Bind 9 和 ISC DHCP 服务器的 Centos 7 VM:

  • Мастер DNS :controller.wsvirt.home (172.16.50.2)
  • 从属 DNS:controller2.wsvirt.home (172.16.50.3)

网络中的所有客户端都是 Linux VM,它们都从 DHCP 服务器获取网络配置。此服务器动态更新 DNS 区域。

Bind 9 是wsvirt.homezone 的权威服务器。

在实验室环境中,我测试了一个必须在我们的商务办公网络中实现的场景。在业务环境中,我应该创建一个 AD 域来为 Windows 客户端提供服务,为此我们决定使用 Samba 4 作为 DC。我已经为 Centos 7 构建了一个 Samba 服务器,并从源代码中获得了 Heimdal Kerberos 支持。

对于 AD,我分配了子网172.16.50.192/26和分配的ad.wsvirt.home域。

AD DC 是一个运行 Samba 4、Bind 9 和 ISC DHCP 服务器的 Centos 7 VM。Samba 使用 BIND_DLZ 作为 DNS 后端。AD 控制器具有addc1.ad.wsvirt.home域名和IP 172.16.50.193.

所有 Windows AD 客户端从动态更新绑定 DLZ 区域的 AD DC 上运行的 DHCP 服务器获取 IP。

在真实的工作物理环境中,来自两个网络的所有客户端 PC 都应该连接到一个广播域。

为了满足要求,我根据 [RFC 2317][1]将服务器上的 Bind 中的正向ad.wsvirt.home和反向DNS 区域授权给 AD 控制器。172.16.50.192/26controller.wsvirt.homeaddc1.ad.wsvirt.home


# 问题 #

除了一件事,一切都完美无缺。当我在 AD DC 上测试委托反向区域的反向查找时,结果看起来不错,因此 Windows AD 客户端可以解析两个域中的所有反向域名。:

$ dig -x 172.16.50.193 @addc1.ad.wsvirt.home

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-9.P2.el7 <<>> -x 172.16.50.193 @addc1.ad.wsvirt.home
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43507
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;193.50.16.172.in-addr.arpa.    IN      PTR

;; ANSWER SECTION:
193.50.16.172.in-addr.arpa. 86400 IN    CNAME   193.50.16.172.ddns.
193.50.16.172.ddns.     900     IN      PTR     addc1.ad.wsvirt.home.

;; Query time: 7 msec
;; SERVER: 172.16.50.193#53(172.16.50.193)
;; WHEN: Mon Mar 30 21:05:12 IDT 2020
;; MSG SIZE  rcvd: 121

但是当我将我的请求路由到 DNS 服务器 ```controller.wsvirt.home``` 时,它不会从 ``ad.wsvirt.home``` 域解析任何反向名称,因此 Linux 客户端无法查找任何反向名称:
$ dig -x 172.16.50.193 @controller.wsvirt.home

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-9.P2.el7 <<>> -x 172.16.50.193 @controller.wsvirt.home
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 48825
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;193.50.16.172.in-addr.arpa.    IN      PTR

;; ANSWER SECTION:
193.50.16.172.in-addr.arpa. 86400 IN    CNAME   193.50.16.172.ddns.

;; AUTHORITY SECTION:
.                       8133    IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2020033001 1800 900 604800 86400

;; Query time: 0 msec
;; SERVER: 172.16.50.2#53(172.16.50.2)
;; WHEN: Mon Mar 30 21:49:41 IDT 2020
;; MSG SIZE  rcvd: 162

**我需要**来自 ```wsvirt.home``` 域的 Linux 客户端能够解析 ```ad.wsvirt.home``` 域中的反向域名。有可能吗?
#配置#

更准确地说,我将两台服务器的配置文件放在这里

服务器控制器.wsvirt.home

/etc/named.conf

acl local { 172.16.50.0/24; 127.0.0.1; };

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/etc/rndc.key";

server 172.16.50.3 {
        keys { "rndc-key"; };
};

...

options {
        listen-on port 53 { local; };
        listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        recursing-file  "/var/named/data/named.recursing";
        secroots-file   "/var/named/data/named.secroots";
        allow-query     { local; };
        allow-transfer { none; };
        notify no; 
        forwarders { 8.8.8.8; 8.8.4.4; };
        forward only;
        recursion yes;
        dnssec-enable yes;
        dnssec-validation yes;
        bindkeys-file "/etc/named.iscdlv.key";
        managed-keys-directory "/var/named/dynamic";
        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};


zone "." IN {
        type hint; 
        file "named.ca";
};

zone "wsvirt.home" IN {
        type master;
        file "wsvirt.home.db";
        allow-update { key "rndc-key"; };
        allow-transfer { key "rndc-key"; };
        notify yes;
        forwarders {};
};

zone "50.16.172.in-addr.arpa" IN {
        type master;
        file "50.16.172.db";
        allow-update { key "rndc-key"; };
        allow-transfer { key "rndc-key"; };
        notify yes;
};

### /var/named/50.16.172.db ### ``` $ORIGIN 。$TTL 86400 ; 1 天 50.16.172.in-addr.arpa 在 SOA 控制器.wsvirt.home。root.wsvirt.home。(153;串行 3600;刷新(1 小时)1800;重试(30 分钟)604800;过期(1 周)86400;最少(1 天))NS controller.wsvirt.home。NS 控制器 2.wsvirt.home。$ORIGIN 50.16.172.in-addr.arpa。2 PTR 控制器.wsvirt.home。$TTL 86400 ; 1 天 3 PTR controller2.wsvirt.home。... ; 50.16.172.ddns。在 NS addc1.ad.wsvirt.home。$GENERATE 193-254 $ CNAME $.50.16.172.ddns。```
### /etc/dhcp/dhcpd.conf ### ``` include "/etc/rndc.key";

默认租赁时间 600;最大租赁时间 7200;权威性; ddns-update-style 过渡;

class "windows" {
match if substring (option vendor-class-identifier, 0, 8) = "MSFT 5.0"; }

子网 172.16.50.0 网络掩码 255.255.255.0 { log (info, concat("Vendor Class ID (60): ", option vendor-class-identifier)); log (info, concat("DHCP Client ID (61): ", option dhcp-client-identifier)); log (info, concat("User Class ID (77): ", option user-class)); 选项域名服务器 172.16.50.2、172.16.50.3;选项 ntp-servers 172.16.50.2;选项路由器 172.16.50.1;选项广播地址 172.16.50.255;默认租赁时间 600;最大租赁时间 7200;选项 ip-forwarding off; 忽略客户端更新;选项域名“wsvirt.home”;选项域搜索“wsvirt.home”;选项 netbios 范围“”;选项 netbios-node-type 8; 选项 netbios-name-servers 172.16.50.2;选项 netbios-dd-server 172.16.50.2;ddns 更新;ddns-域名 "wsvirt.home."; ddns-rev-域名"

    pool {  
            range 172.16.50.21 172.16.50.190;
            deny members of "windows";
    }

    zone wsvirt.home {
            primary 172.16.50.2;
            key "rndc-key";
    }

    zone 50.16.172.in-addr.arpa {
            primary 172.16.50.2;
            key "rndc-key";
    }

}



<br />
## AD DC addc1.ad.wsvirt.home ##

### /etc/named.conf ###

选项 { 监听端口 53 { 任何;}; 监听 v6 端口 53 { ::1; }; 目录“/var/named”;转储文件“/var/named/data/cache_dump.db”;统计文件“/var/named/data/named_stats.txt”;memstatistics-file "/var/named/data/named_mem_stats.txt"; 递归文件“/var/named/data/named.recursing”;secroots-file "/var/named/data/named.secroots"; 允许查询{任何;}; 转发器 { 172.16.50.2; 172.16.50.3;}; 仅转发;递归是的;dnssec-启用否;dnssec-验证号;bindkeys-file "/etc/named.root.key"; 托管键目录“/var/named/dynamic”;pid-file "/run/named/named.pid"; session-keyfile "/run/named/session.key"; tkey-gssapi-keytab "/var/lib/samba/private/dns.keytab"; 最小响应是的;};

...

区“。” IN {类型提示;文件“named.ca”;};

包括“/etc/rndc.key”;包括“/etc/named.rfc1912.zones”;包括“/etc/named.root.key”;包括“/var/lib/samba/bind-dns/named.conf”;


<br />
### /etc/dhcp/dhcpd.conf ###

包括“/etc/rndc.key”;

默认租赁时间 600;最大租赁时间 7200;分秒 5;权威性; ddns-update-style 无;

class "others" { match if substring (option vendor-class-identifier, 0, 8) != "MSFT 5.0"; }

子网 172.16.50.192 网络掩码 255.255.255.192 { log (info, concat("Vendor Class ID (60): ", option vendor-class-identifier)); log (info, concat("DHCP Client ID (61): ", option dhcp-client-identifier)); log (info, concat("User Class ID (77): ", option user-class)); 选项路由器 172.16.50.1;选项广播地址 172.16.50.255;默认租赁时间 600;最大租赁时间 7200;选项 ip-forwarding off; 忽略客户端更新;选项 ntp-servers 172.16.50.193;选项域名服务器 172.16.50.193;选项域名“ad.wsvirt.home”;选项域搜索“ad.wsvirt.home”;选项 netbios-name-servers 172.16.50.193;选项 netbios-dd-server 172.16.50.193;选项 netbios 范围“”;选项 netbios-node-type 8; ddns-rev-域名“ddns”;

pool {
    range 172.16.50.210 172.16.50.254;
    deny members of "others";
}

}

提交时 { set noname = concat("dhcp-", binary-to-ascii(10, 8, "-", leased-address)); 设置 ClientIP = binary-to-ascii(10, 8, ".", 租用地址); set ClientDHCID = concat ( suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,1,1))),2), ":", suffix (concat ("0 ", binary-to-ascii (16, 8, "", substring(hardware,2,1))),2), ":", suffix (concat ("0", binary-to-ascii (16, 8 , "", substring(hardware,3,1))),2), ":", 后缀 (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,4,1 ))),2), ":", 后缀 (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,5,1))),2), ":",后缀 (concat ("0", binary-to-ascii (16, 8, "", 子字符串(硬件,6,1))),2));设置客户端名称 = 选择第一个值(选项主机名、配置选项主机名、客户端名称、无名);log(concat("Commit: IP: ", ClientIP, " DHCID: ", ClientDHCID, " Name: ", ClientName)); 执行("/usr/local/sbin/dhcp-dyndns.sh", "add", ClientIP, ClientDHCID, ClientName); }

发布时 {
设置 ClientIP = binary-to-ascii(10, 8, ".", 租用地址); set ClientDHCID = concat ( suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,1,1))),2), ":", suffix (concat ("0 ", binary-to-ascii (16, 8, "", substring(hardware,2,1))),2), ":", suffix (concat ("0", binary-to-ascii (16, 8 , "", substring(hardware,3,1))),2), ":", 后缀 (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,4,1 ))),2), ":", 后缀 (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,5,1))),2), ":",后缀(concat ("0", binary-to-ascii (16, 8, "", substring(hardware,6,1))),2) );log(concat("发布:IP:", ClientIP)); 执行(“/usr/local/sbin/dhcp-dyndns.sh”,“删除”,ClientIP,ClientDHCID);}

到期时 {
设置 ClientIP = binary-to-ascii(10, 8, ".", 租用地址); log(concat("过期:IP:", ClientIP)); 执行(“/usr/local/sbin/dhcp-dyndns.sh”,“删除”,客户端IP,“”,“0”);}


<br />
### A DLZ revers zone 50.16.172.ddns on the AD DC ###

$ samba-tool dns query localhost 50.16.172.ddns @ALL [[email protected]] 的密码:Name=, Records=2, Children=0 SOA: serial=3, refresh=900, retry=600,过期=86400,minttl=3600,ns=addc1.ad.wsvirt.home.,电子邮件=hostmaster.ad.wsvirt.home。(标志=600000f0,序列=3,ttl=3600)NS:addc1.ad.wsvirt.home。(flags=600000f0, serial=1, ttl=3600) Name=193, Records=1, Children=0 PTR: addc1.ad.wsvirt.home (flags=f0, serial=3, ttl=900) Name=230, Records=1, Children=0 PTR: winxp-1.ad.wsvirt.home (flags=f0, serial=3, ttl=3600)



  [1]: https://www.rfc-editor.org/rfc/rfc2317
active-directory reverse-dns ddns dhcp-server samba4
  • 4 个回答
  • 1186 Views
Martin Hope
umläute
Asked: 2016-12-14 09:02:13 +0800 CST

动态更新区域子域

  • 1

我正在运行bind9(9.9.5)DNS 服务器(在 Debian/jessie 上)。我已将一个区域配置为允许动态更新,并希望TXT为该区域内的特定主机添加记录。

这是一个示例设置(named.conf)

zone "example.com" {
    type master;
    notify yes;
    allow-update { key secret-key; };
    file "/etc/bind/db.example.com";
};

以及随附的 db.example.com 文件:

$ORIGIN .
$TTL 604800 ; 1 week
example.com     IN SOA  dns.example.com root.example.com. (
                1          ; serial
                10800      ; refresh (3 hours)
                3600       ; retry (1 hour)
                604800     ; expire (1 week)
                86400      ; minimum (1 day)
                )
            NS  dns.example.org.
            NS  dns1.example.org.
            NS  dns2.example.org.
$ORIGIN example.com.
*           MX  10 mail.example.com.
mail        A   127.0.0.1
http        A   127.0.1.1

使用我的secret-key,我可以直接在该区域中动态添加新记录(例如创建TXT记录_acme-challenge.example.com)。

但是,我真正想做的是为区域内的主机添加子域记录。例如,在区域example.com中,有一条A记录mail.example.com,我想为其动态添加一条TXT记录_acme-challenge.mail.example.com。

不幸的是,我的域名服务器不喜欢这样并且拒绝使用

密钥:更新区域“example.com/IN”:更新失败:对更新区域没有权威(NOTAUTH)

我可以将该记录手动添加到 db 文件中,它工作正常。

 _acme-challenge.mail TXT "secretstring"

但是,我想自动执行此操作(鉴于这是通过DNS-01质询部署letsencrypt证书的一部分),因此手动设置记录不是一种选择。

任何想法出了什么问题以及如何自动更新我的 TXT 记录?

更新:脚本

实际的更新是用 python-dnspython 实现的,看起来像:

update = dns.update.Update("mail.example.com", ...)
update.add("_acme-challenge", 500, "TXT", token)
response = dns.query.udp(update, name_server_ip)
subdomain bind ddns lets-encrypt
  • 2 个回答
  • 1426 Views
Martin Hope
Obi Juan Canoli
Asked: 2012-06-21 09:29:51 +0800 CST

WinServer 2008R2,两个 NIC,强制应用程序使用其中一个

  • 1

简短问题:有没有办法告诉应用程序使用辅助 NIC 作为路由,即使它具有更高的指标?

长格式问题和解释:

我有一个带有两个 NIC 的 Windows Server 2008R2,每个都连接到不同的 ISP 路由器。我的主要 ISP 给我大约 5 到 10 倍的二级 ISP 带宽,但缺点是路由器的 IP 不是公开的,所以我不能为远程访问进行端口转发(我已经使用 LogMeIn Hamachi 解决了这个问题但是由于涉及隧道,它的速度非常慢)。

问题是,我想使用辅助 NIC(可以通过端口转发访问)作为远程桌面的入口点,但要做到这一点,我需要 Dyn.com 更新客户端使用它来连接到他们的服务器更新我的IP。这可以做到吗?我已经检查过 ISP#2 的路由器,它没有包含理想的 DDNS 更新功能。

windows windows-server-2008 nic ddns
  • 2 个回答
  • 369 Views
Martin Hope
genehack
Asked: 2010-04-08 07:30:17 +0800 CST

如何防止“网络广告加入”进行 DDNS 更新?

  • 2

我正在使用“网络广告加入”将 Linux 服务器添加到 AD 域。这些服务器是多宿主的,在 eth1 上有一个公共 IP,在 eth0 上有一个不可路由的私有后台网络(在 172.20 空间中,用于网络引导和安装等 - 没有路由到该网络上的 Internet)。

当我“加入网络广告”时,似乎正在为 172.20 接口创建 DDNS 条目。我怎样才能防止这种情况发生?

(FWIW,我在 AD 级别的权力非常有限——我可以加入服务器并删除服务器记录,但仅此而已......)

linux active-directory ddns
  • 4 个回答
  • 5538 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve