Implement resolve(server)

This commit is contained in:
世界 2024-10-22 22:01:28 +08:00
parent 41b960552d
commit 179e3cb2f5
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
3 changed files with 65 additions and 44 deletions

View file

@ -584,7 +584,7 @@ func (r *Router) actionSniff(
func (r *Router) actionResolve(ctx context.Context, metadata *adapter.InboundContext, action *rule.RuleActionResolve) error {
if metadata.Destination.IsFqdn() {
// TODO: check if WithContext is necessary
metadata.DNSServer = action.Server
addresses, err := r.Lookup(adapter.WithContext(ctx, metadata), metadata.Destination.Fqdn, action.Strategy)
if err != nil {
return err