【发布时间】:2015-09-19 18:54:55
【问题描述】:
我正在使用带有 BIND 10.1.2 的 linux CentOS 6.64
我在主 DNS (example.com) 中有一个额外的区域 (list.example.com)
绑定(命名)配置文件 /etc/named.conf 包含区域:
zone "list.example.com" IN {
type master;
file "list-example-com.zone";
allow-query { localhost; };
allow-transfer { 127.0.0.1; };
};
Zone文件list-example-com.zone如下:
$TTL 86400 ; 1 day
@ IN SOA ns1.example.com. hostmaster.example.com. (
2004032201 ; serial
7200 ; refresh (2 hours)
5400 ; retry (1.5 hours)
1814400 ; expire (3 weeks)
86400 ; minimum (1 day)
)
IN NS ns1.example.com.
;
IN A 192.168.177.22
;
; -----------------------------------------------------------------
49.30.22.66 IN A 127.0.0.3
44.63.20.10 IN A 127.0.0.2
64.42.10.5 IN A 127.0.0.2
14.3.6.8 IN A 127.0.0.3
// AND OTHER 1000S OF RECORDS LIKE THAT!
让我们选择一个重新编码的 IP 作为示例
IP 44.63.20.10 的“DNS 查找”将是:
44.63.20.10.list.example.com 并将从 DNS 返回 127.0.0.2
好的,现在我想要做的是,我不想列出 1000 条 IP 记录,我只想在 named.conf、区域文件或任何其他文件中运行 PHP 文件来执行一些代码并返回 127.0.0.2 表示“A IP 44.63.20.10 的 DNS”
我的文件.php:
<?php
// Just need to get the required IP (44.63.20.10) and the DNS_TYPE of the request (A, TXT,...ect) then:
// Execute some PHP codes to do some stuff (including connect to mysql database..ect)
// If the IP is TRUE, then return: (44.63.20.10 IN DNS_TYPE X)
?>
我希望你清楚。
我有自己的 PHP 文件,只需要知道是否可以这样做?如果是,那怎么办? 请问有什么办法吗?
谢谢。
【问题讨论】: