惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Hacker News: Front Page
A
About on SuperTechFans
腾讯CDC
罗磊的独立博客
博客园 - Franky
Last Week in AI
Last Week in AI
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
小众软件
小众软件
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
云风的 BLOG
云风的 BLOG
L
LangChain Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
D
Docker
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recorded Future
Recorded Future
Vercel News
Vercel News
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
J
Java Code Geeks
有赞技术团队
有赞技术团队
V
V2EX
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
雷峰网
雷峰网
Jina AI
Jina AI
B
Blog RSS Feed
H
Help Net Security
N
Netflix TechBlog - Medium
Latest news
Latest news
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 司徒正美
Y
Y Combinator Blog
人人都是产品经理
人人都是产品经理
Stack Overflow Blog
Stack Overflow Blog
C
Cisco Blogs
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
P
Proofpoint News Feed
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
T
Threatpost

dnstap on CoreDNS: DNS and Service Discovery

dnstap
Logging with dnstap
varyoo · 2017-08-03 · via dnstap on CoreDNS: DNS and Service Discovery

dnstap is a flexible, structured binary log format for DNS software1. It uses Protocol Buffers to encode events that occur inside DNS software in an implementation-neutral format.

dnstap can encode any DNS message exchanged by the server, along with information about the remote computer (IP address, port) and time. It includes client queries and responses, but also proxied requests or other information requested from other name servers.

This example shows output from the dnstap command-line tool to get an idea of the kind of information that dnstap can provide:

type: MESSAGE
message:
  type: CLIENT_RESPONSE
  socket_family: INET
  socket_protocol: UDP
  query_address: 127.0.0.1
  query_port: 47969
  response_message: |
    ;; opcode: QUERY, status: NOERROR, id: 47163
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;example.org.       IN       A

    ;; ANSWER SECTION:
    example.org.        86339   IN      A       93.184.216.34

A dnstap plugin has been added in CoreDNS-010. Currently it can only log client level messages. Logging for additional types of exchanges is being implemented.

The dnstap plugin is used in combination with the dnstap command-line tool. They use a socket to communicate: the plugin will send the logs as long as the tool is listening.

To start with the dnstap plugin add it to the Corefile in a server block:

dnstap /tmp/dnstap.sock full

With the full option given to the dnstap plugin you will also include the full (binary) data of the DNS message. Now you can use the dnstap tool to read from the socket where CoreDNS writes to.

$ dnstap -u /tmp/dnstap.sock

Or listen on the dnstap socket and store message payloads to a binary dnstap-format log file:

$ dnstap -u /tmp/dnstap.sock -w /tmp/july.dnstap

And then read back July’s logs in the YAML-format:

$ dnstap -r /tmp/july.dnstap -y