Skip to content

dnstap sourceAddress: "0.0.0.0" instead of real client IP when using TCP transport #25181

@YangTao0

Description

@YangTao0

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

Version: CoreDNS-1.12.0 version="0.54.0"(receiving dnstap over TCP)
Not Kubernetes: CoreDNS is deployed directly on a VM (bare metal).
Network : The CoreDNS server and Vector server are on different hosts.
The sourceAddress field in the dnstap message should contain the real IP address of the DNS client (e.g., the host that sent the query to CoreDNS), All dnstap messages show "sourceAddress": "0.0.0.0",Is this a known limitation of the dnstap plugin when using TCP transport? Or am I missing a configuration option to preserve the client address information over TCP?

Configuration

**CoreDNS config**:
.:53 { log dnstap tcp://10.218.20.156:6000 full forward . 8.8.8.8 reload }

**Vector Config**:
[sources.dnstap]
type = "dnstap"
address = "0.0.0.0:6000"
mode = "tcp"

[sinks.print]
type = "console"
inputs = [ "dnstap" ]
encoding.codec = "json"

Version

version="0.54.0" arch="x86_64"

Debug Output

Vector logs:
{
	"dataType": "Message",
	"dataTypeId": 1,
	"host": "10.218.20.204:51984",
	"messageType": "ClientQuery",
	"messageTypeId": 5,
	"requestData": {
		"fullRcode": 0,
		"header": {
			"aa": false,
			"ad": true,
			"anCount": 0,
			"arCount": 1,
			"cd": false,
			"id": 3539,
			"nsCount": 0,
			"opcode": 0,
			"qdCount": 1,
			"qr": 0,
			"ra": false,
			"rcode": 0,
			"rd": true,
			"tc": false
		},
		"opt": {
			"do": false,
			"ednsVersion": 0,
			"extendedRcode": 0,
			"udpPayloadSize": 4096
		},
		"question": [{
			"class": "IN",
			"domainName": "www.baidu.com.",
			"questionType": "A",
			"questionTypeId": 1
		}],
		"rcodeName": "NoError"
	},
	"serverId": "vector02-test3-ucscompute43-cloudvsp",
	"serverVersion": "CoreDNS-1.12.0",
	"socketFamily": "INET",
	"socketProtocol": "UDP",
	"sourceAddress": "0.0.0.0",
	"sourcePort": 46185,
	"source_type": "dnstap",
	"time": 1776072095889631680,
	"timePrecision": "ns",
	"timestamp": "2026-04-13T09:21:35.889631680Z"
}

CoreDNS logs:
maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined
.:53
[INFO] plugin/reload: Running configuration SHA512 = 9d43073b6aed7d04aa3bac96b5704a48d8e6bbe996c42df661a0e2497737d16c7f11e490c15691e73245652251679586a0458ebfb869994a2f1f48d2bd932d59
CoreDNS-1.12.0
linux/amd64, go1.23.3, 51e11f1
[INFO] 10.221.7.182:46185 - 3539 "A IN www.baidu.com. udp 42 false 4096" NOERROR qr,rd,ra 149 0.217670503s

10.221.7.182:46185 is real client IP ,but vector output "sourceAddress": "0.0.0.0".

Example Data

No response

Additional Context

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions