{
  "log": {
    "level": "warn",
    "timestamp": true
  },
  "dns": {
    "servers": [
      {
        "type": "fakeip",
        "tag": "openai-fake",
        "inet4_range": "198.19.0.0/16",
        "inet6_range": "fd74:6f70:656e::/48"
      },
      {
        "type": "udp",
        "tag": "original-dns",
        "server": "192.168.35.1"
      }
    ],
    "rules": [
      {
        "domain_suffix": [
          "chatgpt.com",
          "openai.com"
        ],
        "query_type": [
          "HTTPS",
          "SVCB"
        ],
        "action": "predefined",
        "rcode": "NOERROR"
      },
      {
        "domain_suffix": [
          "chatgpt.com",
          "openai.com"
        ],
        "query_type": [
          "A",
          "AAAA"
        ],
        "action": "route",
        "server": "openai-fake",
        "rewrite_ttl": 60
      }
    ],
    "final": "original-dns",
    "disable_cache": true
  },
  "inbounds": [
    {
      "type": "direct",
      "tag": "dns-in",
      "listen": "127.0.0.1",
      "listen_port": 15353,
      "override_address": "192.168.35.1",
      "override_port": 53
    },
    {
      "type": "redirect",
      "tag": "transparent4",
      "listen": "0.0.0.0",
      "listen_port": 18083
    },
    {
      "type": "redirect",
      "tag": "transparent6",
      "listen": "::",
      "listen_port": 18084
    }
  ],
  "outbounds": [
    {
      "type": "http",
      "tag": "existing-proxy",
      "server": "127.0.0.1",
      "server_port": 1081
    }
  ],
  "route": {
    "rules": [
      {
        "inbound": [
          "dns-in"
        ],
        "action": "hijack-dns"
      },
      {
        "domain_suffix": [
          "chatgpt.com",
          "openai.com"
        ],
        "action": "route",
        "outbound": "existing-proxy"
      },
      {
        "action": "reject"
      }
    ],
    "default_domain_resolver": "original-dns"
  },
  "experimental": {
    "cache_file": {
      "enabled": true,
      "path": "/var/lib/openai-domain-router/fakeip.db",
      "store_fakeip": true
    }
  }
}
