MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
16.51k stars 2.65k forks source link

[Feature] How to cache DNS responses? #686

Open Azadzadeh opened 1 year ago

Azadzadeh commented 1 year ago

Verify steps

Description

is it possible to save or cache dns query responses so clash doesn't query the dns server every time a request to a domain is being made?

Possible Solution

an option in config file under dns to set the cache invalidation time so the lookup table could be reset after that time and refilled on new requests.

hkthomas commented 1 year ago

You can install some cache DNS server on the front, upstream use clashsDNS and ports.

lux5am commented 1 year ago

I think it is cached based on ttl. If you use nextdns you can make the ttl longer so clash would hold it longer in the cache also. Anyway I'm using adguardhome with clash as upstream

Screenshot_20230813-070457_Termux