Skip to content

F5 配置 DNS 解析日志

背景:用户想要统计 F5 DNS 解析资源记录结果,需要配置 F5 DNS 记录请求解析和响应结果到日志中。

1、创建 Log Publishers🐿️

​ 导航至System ›› Logs : Configuration : Log Publishers路径,新建 Log Publishers ,以将日志发送到一组指定的日志目标,在这里我们把日志发送至local-syslog中。

image-20220313160953779

2、创建 DNS Logging Profile🐇

​ 导航至DNS ›› Delivery : Profiles : Other : DNS Logging路径,新建 DNS 日志配置文件,并关联上一步创建的Log Publisher.

image-20220313202019788

3、创建 DNS Profile🦥

​ 导航至DNS ›› Delivery : Profiles : DNS路径,新建 DNS 配置文件,并选择上一步创建的Logging Profile.

image-20220313202915830

4、创建 Listeners🦘

​ 导航至DNS ›› Delivery : Listeners : Listener List路径,创建DNS Listener,并关联上一步创建的DNS Profile

image-20220313203331507

5、DNS 解析测试🐐

注:解析日志存储在/var/log/ltm

示例如下:

image-20220310154158461

Event 请求格式:

sh
2022-03-10 15:40:39 bigip1.com from 192.168.10.222#21919: view none: query: app.example.choerodon.io IN A +E (192.168.10.83%0)

2022-03-10 15:40:39 : 请求时间戳
bigip1.com 请求主机
from 来源
192.168.10.222#21919 来源地址#端口号
view none view视图空
query 请求
app.example.choerodon.io 请求域名
IN Internet
A A记录
192.168.10.83%0 Listener监听地址

Event 响应格式:

sh
2022-03-10 15:40:39 bigip1.com to 192.168.10.222#21919: [NOERROR qr,aa,rd,ra] response: app.example.choerodon.io. 60 IN A 192.168.30.136;

2022-03-10 15:40:39 : 请求时间戳
bigip1.com 请求主机
to 去往
192.168.10.222#21919 发送至地址#端口号
[NOERROR qr,aa,rd,ra] :flags 标志 ,更多详细信息请见[DNS报文详解][1]
NOERROR 响应码为0,表示没有错误。
qr(Response) : 查询/响应的标志位
aa(Authoritative) : 授权应答标志位。
rd(Recursion desired) : 期望递归标志位
ra(Recursion available) : 可用递归标志位
response 响应
app.example.choerodon.io 响应域名
60 TTL
IN Internet
A A记录
192.168.30.136 :返回A记录结果