#3590·v2ray-core

[BUG] GetFakeIPForDomain3 panic: runtime error: invalid memory address or nil pointer dereference

Author: 4-FLOSS-Free-Libre-Open-Source-SoftwareCreated Jan 8, 2026Updated Aug 4, 2026

What version of V2Ray are you using?

V2Ray 5.41.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.24.2 linux/amd64)

What's your scenario of using V2Ray?

tproxy

What problems have you encountered?

signal SIGSEGV: segmentation violation panic: runtime error: invalid memory address or nil pointer dereference

What's your expectation?

working FakeDNSEngine

Please attach your configuration here

Server configuration:

// Please attach your server configuration here.
  v2ray:
    restart: always
    env_file:
      - ./v2ray.env
    container_name: v2ray
    # image: v2fly/v2fly # outdated lazy maintainer
    image: ghcr.io/v2fly/v2ray:latest-extra
    network_mode: host
    command: "run -r"
    volumes:
      - ./config.jsonc:/etc/v2ray/config.json:ro

Client configuration:

// Please attach your client configuration here.
// Please attach your client configuration here.
  "inbounds": [
    {
      "tag": "dns-v4",
      "listen": "127.0.0.1",
      "port": 5354,
      "protocol": "dokodemo-door",
      "settings": {
        "followRedirect": false,
        "network": "tcp,udp",
        "address": "127.0.0.1",
        "port": 53
      },
      }
    },
  // List of outbound proxy configurations.
  "outbounds": [
    {
      "tag": "dns",
      "protocol": "dns",
      }
    },
    "rules": [
      // FakeDNS
      {
        "inboundTag": [
          "dns-v4"
        ],
        "outboundTag": "dns",
        "type": "field"
      },
  "dns": {
    "cacheStrategy": "Disabled",
    "disableCache": true,
    "fallbackStrategy": "DisabledIfAnyMatch",
    "servers": [
      {
        "address": "127.0.0.1",
        "port": 53,
        "fallbackStrategy": "DisabledIfAnyMatch",
        "cacheStrategy": "Disabled",
        "disableCache": true
      },
      {
        "address": "127.0.0.1",
        "port": 53,
        "fallbackStrategy": "DisabledIfAnyMatch",
        "cacheStrategy": "Disabled",
        "queryStrategy": "UseIP",
        "disableCache": true,
        "fakedns": true,
        "domains": [
          "domain:google-analytics.com",
          "domain:googletagmanager.com"
      }
    ]
  },

Please attach error logs here

Server error log:

// Please attach your server error log here.

Client error log:

// Please attach your client error log here.

Please attach access log here

// Please attach your server access log here.

Other configurations (such as Nginx) and logs here

If V2Ray cannot start up, please attach output from --test command

If V2Ray service is abnormal, please attach journal log here

V2Ray 5.41.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.24.2 linux/amd64)
Using confdir from env: /etc/v2ray
A unified platform for anti-censorship.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xb11d3b]

goroutine 103 [running]:
github.com/v2fly/v2ray-core/v5/app/dns/fakedns.(*Holder).GetFakeIPForDomain3(0x10?, {0xc0006f2000?, 0x1?}, 0x8?, 0x9?)
        github.com/v2fly/v2ray-core/v5/app/dns/fakedns/fake.go:37 +0x1b
github.com/v2fly/v2ray-core/v5/app/dns/fakedns.(*HolderMulti).GetFakeIPForDomain3(0x25cbed0?, {0xc0006f2000, 0x17}, 0x1, 0x0)
        github.com/v2fly/v2ray-core/v5/app/dns/fakedns/fake.go:167 +0xf5
github.com/v2fly/v2ray-core/v5/app/dns.(*FakeDNSServer).QueryIP(0xc0005bc040, {0x199c190?, 0xc0006ce5b0?}, {0xc0006f2000, 0x17}, {0xc0006cc2a0?, 0xc0006c0600?, 0xc0006f2018?}, {0x1, 0x0, ...}, ...)
        github.com/v2fly/v2ray-core/v5/app/dns/nameserver_fakedns.go:39 +0x255
github.com/v2fly/v2ray-core/v5/app/dns.(*Client).QueryIP(0xc000510480, {0x199c0e8, 0xc0005085a0}, {0xc0006f2000, 0x17}, {0x0?, 0x0?, 0x0?})
        github.com/v2fly/v2ray-core/v5/app/dns/nameserver.go:196 +0x1b9
github.com/v2fly/v2ray-core/v5/app/dns.(*DNS).lookupIPInternal(0xc0002d7b20, {0xc0006f2000, 0x18}, {0x0?, 0x0?, 0x0?})
        github.com/v2fly/v2ray-core/v5/app/dns/dns.go:298 +0x5f9
github.com/v2fly/v2ray-core/v5/app/dns.(*FakeDNSClient).LookupIPv4(0xc00063a200?, {0xc0006f2000?, 0x18?})
        github.com/v2fly/v2ray-core/v5/app/dns/fakedns.go:24 +0x25
github.com/v2fly/v2ray-core/v5/proxy/dns.(*Handler).handleIPQuery(0xc0006ce540?, 0xa18, 0x1, {0xc0006f2000, 0x18}, {0x1986540, 0xc0006cc130})
        github.com/v2fly/v2ray-core/v5/proxy/dns/dns.go:259 +0xcf
created by github.com/v2fly/v2ray-core/v5/proxy/dns.(*Handler).Process.func2 in goroutine 63
        github.com/v2fly/v2ray-core/v5/proxy/dns/dns.go:209 +0x2c5