大网数据广告活动
服务器运维问答

DNS - forwarded for

· 52CE 我爱测

Is there any mechanism for DNS to forward requests on behalf of someone else? Like XFF or "X-Forwarded-For" for HTTP. In Detail: I have a network structure like below: (Clients) ------> (A router) -----> (modem) ----> ISP Now, I …

问题原文

原帖链接 · 0xmtn · CC BY-SA 3.0

Is there any mechanism for DNS to forward requests on behalf of someone else? Like XFF or "X-Forwarded-For" for HTTP.

In Detail:

I have a network structure like below:

(Clients) ------> (A router) -----> (modem) ----> ISP

Now, I want the router to redirect DNS requests of a client to a remote server outside of the LAN, which is pretty much straightforward. But also I want that remote server to know which client issued this DNS request. Is it possible using only iptables?

已采纳解答

原帖链接 · kasperd · CC BY-SA 3.0

There is RFC 7871 which due to operational and privacy shortcomings does not yet have standards status. It uses an EDNS option which works very similar to X-Forwarded-For with the possibility to only include as many bits of the address as you deem appropriate for your usage case.

Matching this field using a firewall is going to be challenging because it is at the end of the request which means the offset is varying and the packet could be fragmented such that it cannot be identified without first reassembling the packet. Judging from the man page on my machine there seem to be no DNS specific filters in iptables.

Adding the field from a mangling rule in the firewall is going to be even more challenging. Thus you should most likely be looking for an application layer solution rather than a firewall, or avoid sending the packets through NAT.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-10-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。