Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Local Hostnames cannot be accessed in FAKE-IP mode. #4298

Open
6 of 7 tasks
TJT-JTJ opened this issue Jan 23, 2025 · 7 comments
Open
6 of 7 tasks

[Bug] Local Hostnames cannot be accessed in FAKE-IP mode. #4298

TJT-JTJ opened this issue Jan 23, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@TJT-JTJ
Copy link
Contributor

TJT-JTJ commented Jan 23, 2025

Verify Steps

  • Tracker 我已经在 Issue Tracker 中找过我要提出的问题
  • Branch 我知道 OpenClash 的 Dev 分支切换开关位于插件设置-版本更新中,或者我会手动下载并安装 Dev 分支的 OpenClash
  • Latest 我已经使用最新 Dev 版本测试过,问题依旧存在
  • Relevant 我知道 OpenClash 与 内核(Core)、控制面板(Dashboard)、在线订阅转换(Subconverter)等项目之间无直接关系,仅相互调用
  • Definite 这确实是 OpenClash 出现的问题
  • Contributors 我有能力协助 OpenClash 开发并解决此问题
  • Meaningless 我提交的是无意义的催促更新或修复请求

OpenClash Version

v0.46.066

Bug on Environment

Official OpenWrt

OpenWrt Version

23.05

Bug on Platform

Linux-armv7

Describe the Bug

When in Fake-IP mode, local hostnames seem to be ineffective and the DNS returns a fake IP. When using redir-host mode, this issue is not present.

To Reproduce

Create hostname within Openwrt DNS settings for local device, set OpenClash to Fake-IP mode. Hostname cannot be used. nslookup returns a 'fake IP' which does not seem to resolve to the local network device.

In my instance, I have several APs which I access via their hostnames, as well as the router itself with a hostname configured.

OpenClash Log

(Terminal nslookup)

nslookup h3c-ap

Server:		10.0.0.1
Address:	10.0.0.1#53

Name:	h3c-ap.lan
Address: 198.18.0.78

OpenClash Config

N/A

Expected Behavior

Hostnames are usable from local network devices

Additional Context

No response

@TJT-JTJ TJT-JTJ added the bug Something isn't working label Jan 23, 2025
@vernesong
Copy link
Owner

use fake-ip-filter

@TJT-JTJ
Copy link
Contributor Author

TJT-JTJ commented Jan 24, 2025

use fake-ip-filter

That doesn't seem to work either. With fake-ip-filter in blacklist mode and the hostnames added, it returns no IP at all

Server:  UnKnown
Address:  10.0.0.1

*** UnKnown can't find homebridge: Non-existent domain```

@vernesong
Copy link
Owner

what is the dns server used by resolving this domain

@TJT-JTJ
Copy link
Contributor Author

TJT-JTJ commented Jan 24, 2025

DNS server is the router itself (10.0.0.1) with hostnames set in the DNS/DHCP settings of OpenWrt

@vernesong
Copy link
Owner

nameserver-policy:
    "h3c-ap": 10.0.0.1

@TJT-JTJ
Copy link
Contributor Author

TJT-JTJ commented Jan 24, 2025

That works for the hostname for the router itself, other hostnames don't work. This was the same when using fake-ip-filter too (now also using the Nameserver-Policy)

#nameserver-policy:
'pi': '10.0.0.1'
'homebridge': '10.0.0.221'

#fake-ip-filter:
pi
homebridge

#results in nslookup homebridge
Server:		10.0.0.1
Address:	10.0.0.1#53

** server can't find homebridge: SERVFAIL

@vernesong
Copy link
Owner

nameserver-policy:
'.pi': '10.0.0.1'
'
.homebridge': '10.0.0.1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants