2023 The frp Authors 保留所有权利
中文|English
DNS 查询请求通常使用 UDP 协议,而 frp 支持对内网 UDP 服务的穿透,配置方式与 TCP 类似。
配置 frps.toml
在 frps.toml 文件中添加以下内容:
bindPort = 7000
配置 frpc.toml
在 frpc.toml 文件中添加以下内容:
serverAddr = "x.x.x.x"
serverPort = 7000
[[proxies]]
name = "dns"
type = "udp"
localIP = "8.8.8.8"
localPort = 53
remotePort = 6000
请注意,这里示例中反代了 Google 的 DNS 查询服务器的地址,仅用于测试 UDP 代理,并没有实际意义。
启动 frps 和 frpc
分别启动 frps 和 frpc。
测试 DNS 查询请求
使用以下命令通过 dig
工具测试 UDP
包转发是否成功,预期会返回
www.baidu.com
域名的解析结果:
dig @x.x.x.x -p 6000 www.baidu.com
DNS query requests typically use UDP protocol, while frp supports UDP for internal networks The penetration of services and the configuration method are similar to TCP.
Configuration frps.toml
Add the following content to the frps.toml file:
bindPort = 7000
Configuration frpc.toml
Add the following content to the frps.toml file:
serverAddr = "x.x.x.x"
serverPort = 7000
[[proxies]]
name = "dns"
type = "udp"
localIP = "8.8.8.8"
localPort = 53
remotePort = 6000
Please note that the example here represents Google's DNS in reverse Querying the server's address is only for testing UDP agents and has no practical significance.
Start FRPS and FRPC
Start FRPS and FRPC separately
Test DNS query requests
Use the following command to test UDP using
thedig
tool Whether the packet forwarding was
successful, expected to return
www.baidu. com
Domain name resolution result:
dig @x.x.x.x -p 6000 www.baidu.com