Skip to content

Using UrlRewriter triggers DNS reverse resolution of the remote host #9

@jocutajar

Description

@jocutajar

Hi,

Refer to SO for further context.

I identified this code in RewriteContext as the culprit:

            // Initialise the Properties collection from all the server variables, headers and cookies.
            foreach (string key in httpContext.ServerVariables.AllKeys)
            {
                _properties.Add(key, httpContext.ServerVariables[key]);
            }

REMOTE_HOST is a dynamic property that gets calculated only on access. Here UrlRewriter makes a copy of all server variables, triggering DNS requests even if not used anywhere in the app or rewriting rules.

Cheers, Rob

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions