[GH-ISSUE #211] 内网解析如何配置? #144

Closed
opened 2026-05-05 11:51:29 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @idoall on GitHub (Jan 4, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/211

问题描述

内网的网关是10.10.10.1
在网关上配置了域名转发a.com指向10.10.10.10

然后在10.10.10.10上启动了frps用的是特权模式

在另一台机器10.10.10.5启动frpc,连接到10.10.10.10。并在10.10.10.5上设置a.com转发到10.10.10.7上。

然后访问a.com,打不开,好像frps默认上公网做DNS解析,内网10.10.10.1上配置的域名解析不起作用。

PS:我在10.10.10.10上ping a.com,返回的ip是10.10.10.10

问题

如果frps在公网上做DNS解析,有办法设置,在内网指定DNS解析的IP吗?

以下是在10.10.10.10上frps的配置

# [common] is integral section
[common]
bind_addr = 0.0.0.0
bind_port = 7000

vhost_http_port = 80

privilege_mode = true
privilege_token = 123456

以下是在10.10.10.5上frpc的配置

# [common] is integral section
[common]
server_addr = 10.10.10.10
server_port = 7000
log_level = info
log_max_days = 3
auth_token = 123
privilege_token = 123456

[a.com]
privilege_mode = true
type = http
local_ip = 10.10.10.7
local_port = 80
use_encryption = true
use_gzip = true
custom_domains = a.com
Originally created by @idoall on GitHub (Jan 4, 2017). Original GitHub issue: https://github.com/fatedier/frp/issues/211 **问题描述** 内网的网关是10.10.10.1 在网关上配置了域名转发a.com指向10.10.10.10 然后在10.10.10.10上启动了frps用的是特权模式 在另一台机器10.10.10.5启动frpc,连接到10.10.10.10。并在10.10.10.5上设置a.com转发到10.10.10.7上。 然后访问a.com,打不开,好像frps默认上公网做DNS解析,内网10.10.10.1上配置的域名解析不起作用。 PS:我在10.10.10.10上ping a.com,返回的ip是10.10.10.10 **问题** 如果frps在公网上做DNS解析,有办法设置,在内网指定DNS解析的IP吗? 以下是在10.10.10.10上frps的配置 ``` # [common] is integral section [common] bind_addr = 0.0.0.0 bind_port = 7000 vhost_http_port = 80 privilege_mode = true privilege_token = 123456 ``` 以下是在10.10.10.5上frpc的配置 ``` # [common] is integral section [common] server_addr = 10.10.10.10 server_port = 7000 log_level = info log_max_days = 3 auth_token = 123 privilege_token = 123456 [a.com] privilege_mode = true type = http local_ip = 10.10.10.7 local_port = 80 use_encryption = true use_gzip = true custom_domains = a.com ```
Author
Owner

@fatedier commented on GitHub (Jan 4, 2017):

a.com 对于 frps 来说是不需要解析的,frps 只是根据 http 请求的 host 中的 a.com 来决定要将这个 http 请求发往哪一个 proxy(frpc)。

你需要明确打不开是什么错误,这个描述不够具体。建议通过 curl -v 进行请求然后将输出结果发出来。

<!-- gh-comment-id:270364868 --> @fatedier commented on GitHub (Jan 4, 2017): `a.com` 对于 frps 来说是不需要解析的,frps 只是根据 http 请求的 host 中的 `a.com` 来决定要将这个 http 请求发往哪一个 proxy(frpc)。 你需要明确打不开是什么错误,这个描述不够具体。建议通过 `curl -v` 进行请求然后将输出结果发出来。
Author
Owner

@idoall commented on GitHub (Jan 5, 2017):

内网现在改用haproxy解决了,当时的环境找不到,先关闭问题

<!-- gh-comment-id:270558077 --> @idoall commented on GitHub (Jan 5, 2017): 内网现在改用haproxy解决了,当时的环境找不到,先关闭问题
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#144
No description provided.