Skip to content

[Feature Request] Specify IP address for outbound/DoH/DoT domain in configuration #309

@Robot-DaneelOlivaw

Description

@Robot-DaneelOlivaw

Please answer all the questions with enough information. All issues not following this template will be closed immediately.
If you are not sure if your question is truely a bug in V2Ray, please discuss it here first.

  1. What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?
    V2Ray 4.31.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.15.2 darwin/amd64)

  2. What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.
    Filtering advertisements, providing encrypted DNS.

  3. What did you see? (Please describe in detail, such as timeout, fake TLS certificate etc)
    When using a domain name to specify server in VMess/VLESS outbound connections, V2Ray resolves the domain via localhost, which ends up spamming DNS with tons of requests. Same behavior can be found in DoH/DoT as well. This could lead to lower performance or security risks.

  4. What's your expectation?
    According to Section 10, RFC 8484, the initial resolution can be made into part of the configuration or resolved via a traditional DNS. So possible solutions include:

  • Resolve Outbound/DoH/DoT domain with hosts section. V2Ray can checkout hosts of built-in DNS before trying to reach out localhost.
Example configuration
  "outbounds": [{
    "protocol": "vless",
    "settings": {
      "vnext": [{
        "address": "example.com",
        "port": 443,
        "users": [{
          "id": "27848739-7e62-4138-9fd3-098a63964b6b",
          "encryption": "none"
          }]
      }]
    },
  },

  "dns": {
    "hosts": {
      "example.com": "12.34.56.78",
      "dns.google": "8.8.8.8"
    },
    "servers": [
      "https+local://dns.google/dns-query"
    ]
  }
  • A dedicated new option to specify IP address for Outbound/DoH/DoT. This is what Firefox does with the option network.trr.bootstrapAddress.
Example configuration
  "outbounds": [{
    "protocol": "vless",
    "settings": {
      "vnext": [{
        "address": "example.com",
        "bootstrap": "12.34.56.78",
        "port": 443,
        "users": [{
          "id": "27848739-7e62-4138-9fd3-098a63964b6b",
          "encryption": "none"
          }]
      }]
    },
  },

  "dns": {
    "servers": [
      {
        "address": "https+local://dns.google/dns-query",
        "bootstrap": "8.8.8.8"
      }
    ]
  }
  • Use traditional DNS in built-in DNS or specify bootstrap DNS to resolve domain of Outbound/DoH/DoT.
Example configuration
  "outbounds": [{
    "protocol": "vless",
    "settings": {
      "vnext": [{
        "address": "example.com",
        "port": 443,
        "users": [{
          "id": "27848739-7e62-4138-9fd3-098a63964b6b",
          "encryption": "none"
          }]
      }]
    },
  },

  "dns": {
    "servers": [
      "https+local://dns.google/dns-query",
      "1.1.1.1"
    ],
    "bootstrap": [
      "8.8.8.8",
      "1.1.1.1"
    ]
  }
  1. Please attach your configuration file (Mask IP addresses before submit this issue).
    Client configuration:

  2. Please attach error logs, especially the bottom lines if the file is large. Error log file is usually at /var/log/v2ray/error.log on Linux.

  3. Please attach access log. Access log is usually at '/var/log/v2ray/access.log' on Linux.

  4. Other configurations (such as Nginx) and logs.

  5. If V2Ray doesn't run, please attach output from --test.

The command is usually /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json, but may vary according to your scenario.

  1. If V2Ray service doesn't run, please attach journal log.

Usual command is journalctl -u v2ray.

Please review your issue before submitting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions