[GH-ISSUE #3632] Question: [Help] DNS Settings #2439

Closed
opened 2026-10-31 20:25:31 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @janusn on GitHub (Jan 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3632

Question

I have recently set up a 2x-ui docker container. A Happ client can connect to websites with ip via 3x-ui but DNS query fails.

Running nslookup inside the 3x-ui container works fine.

How to configure DNS for clients?

Thanks in advance.

The exported Inbounds from WebUI:

{
  "id": 1,
  "userId": 0,
  "up": 0,
  "down": 0,
  "total": 0,
  "allTime": 0,
  "remark": "Hunny",
  "enable": true,
  "expiryTime": 0,
  "trafficReset": "never",
  "lastTrafficResetTime": 0,
  "listen": "",
  "port": 443,
  "protocol": "vless",
  "settings": "{\n  \"clients\": [\n    {\n      \"comment\": \"\",\n      \"created_at\": 1767481002000,\n      \"email\": \"john doe\",\n      \"enable\": true,\n      \"expiryTime\": 0,\n      \"flow\": \"xtls-rprx-vision\",\n      \"id\": \"<<REDACTED>>\",\n      \"limitIp\": 0,\n      \"reset\": 0,\n      \"subId\": \"<<REDACTED>>\",\n      \"tgId\": 0,\n      \"totalGB\": 0,\n      \"updated_at\": 1767481002000\n    },\n  ],\n  \"decryption\": \"none\",\n  \"encryption\": \"none\",\n  \"fallbacks\": [\n    {\n      \"alpn\": \"\",\n      \"dest\": \"10.27.0.203:443\",\n  ],\n  \"testseed\": [\n    900,\n    500,\n    900,\n    256\n  ]\n}",
  "streamSettings": "{\n  \"network\": \"tcp\",\n  \"security\": \"reality\",\n  \"externalProxy\": [],\n  \"realitySettings\": {\n    \"show\": false,\n    \"xver\": 0,\n    \"target\": \"apple.com:443\",\n    \"serverNames\": [\n      \"Apple.com\",\n      \"www.apple.com\"\n    ],\n    \"privateKey\": \"<<REDACTED>>\",\n    \"minClientVer\": \"\",\n    \"maxClientVer\": \"\",\n    \"maxTimediff\": 0,\n    \"shortIds\": [\n      \"<<REDACTED>>\",\n      \"<<REDACTED>>\",\n      \"<<REDACTED>>\",\n      \"<<REDACTED>>\",\n      \"<<REDACTED>>\",\n      \"<<REDACTED>>\",\n      \"<<REDACTED>>\",\n      \"<<REDACTED>>\"\n    ],\n    \"mldsa65Seed\": \"<<REDACTED>>\",\n    \"settings\": {\n      \"publicKey\": \"<<REDACTED>>\",\n      \"fingerprint\": \"chrome\",\n      \"serverName\": \"\",\n      \"spiderX\": \"/\",\n      \"mldsa65Verify\": \"<<REDACTED>>\"\n    }\n  },\n  \"tcpSettings\": {\n    \"acceptProxyProtocol\": false,\n    \"header\": {\n      \"type\": \"none\"\n    }\n  }\n}",
  "tag": "inbound-443",
  "sniffing": "{\n  \"enabled\": false,\n  \"destOverride\": [\n    \"http\",\n    \"tls\",\n    \"quic\",\n    \"fakedns\"\n  ],\n  \"metadataOnly\": false,\n  \"routeOnly\": false\n}",
  "clientStats": [
    {
      "id": 1,
      "inboundId": 1,
      "enable": true,
      "email": "john doe",
      "uuid": "<<REDACTED>>",
      "subId": "<<REDACTED>>",
      "up": 0,
      "down": 0,
      "allTime": 0,
      "expiryTime": 0,
      "total": 0,
      "reset": 0,
      "lastOnline": 0
    }
  ]
}

The content of the All textbox from XRay Configs->Advanced

{
  "log": {
    "access": "/var/log/xray/access.log",
    "dnsLog": false,
    "error": "/var/log/xray/error.log",
    "loglevel": "warning",
    "maskAddress": ""
  },
  "api": {
    "tag": "api",
    "services": [
      "HandlerService",
      "LoggerService",
      "StatsService"
    ]
  },
  "inbounds": [
    {
      "tag": "api",
      "listen": "127.0.0.1",
      "port": 62789,
      "protocol": "tunnel",
      "settings": {
        "address": "127.0.0.1"
      }
    }
  ],
  "outbounds": [
    {
      "tag": "direct",
      "protocol": "freedom",
      "settings": {
        "domainStrategy": "AsIs",
        "redirect": "",
        "noises": []
      }
    },
    {
      "tag": "blocked",
      "protocol": "blackhole",
      "settings": {}
    }
  ],
  "policy": {
    "levels": {
      "0": {
        "statsUserDownlink": true,
        "statsUserUplink": true
      }
    },
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true,
      "statsOutboundDownlink": false,
      "statsOutboundUplink": false
    }
  },
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api"
      },
      {
        "type": "field",
        "outboundTag": "blocked",
        "ip": [
          "geoip:private"
        ]
      },
      {
        "type": "field",
        "outboundTag": "blocked",
        "protocol": [
          "bittorrent"
        ]
      }
    ]
  },
  "stats": {},
  "metrics": {
    "tag": "metrics_out",
    "listen": "127.0.0.1:11111"
  }
}

compose.yaml

---
services:
  3x-ui:
    image: ghcr.io/mhsanaei/3x-ui:latest
    container_name: 3x-ui
    hostname: nuc13-3x-ui
    deploy:
      resources:
        limits:
          memory: 512M
    environment:
      TZ: "Europe/London"
      XRAY_VMESS_AEAD_FORCED: "false"
      XUI_ENABLE_FAIL2BAN: "false"
    volumes:
    - ./config/db/:/etc/x-ui/:rw
    - ./cert/:/root/cert/:rw
    - /mnt/tank/logs/3x-ui/:/var/log/:rw
    tty: true
    ports:
    - "2054:2054"
    - "443:443"
    - "443:443/udp"
    logging:
      driver: json-file
      options:
        max-size: 100m
        max-file: 10

    restart: unless-stopped

access.log

2026/01/05 09:29:28.002056 from 127.0.0.1:43608 accepted tcp:127.0.0.1:62789 [api -> api]
2026/01/05 09:29:38.002474 from 127.0.0.1:51126 accepted tcp:127.0.0.1:62789 [api -> api]
2026/01/05 09:29:48.001438 from 127.0.0.1:54964 accepted tcp:127.0.0.1:62789 [api -> api]
...
2026/01/05 09:41:08.001855 from 127.0.0.1:53928 accepted tcp:127.0.0.1:62789 [api -> api]
2026/01/05 09:41:18.002547 from 127.0.0.1:40240 accepted tcp:127.0.0.1:62789 [api -> api]
2026/01/05 09:41:28.002276 from 127.0.0.1:54878 accepted tcp:127.0.0.1:62789 [api -> api]

error.log

2026/01/04 14:57:25.922494 [Warning] core: Xray 25.12.8 started

Client:
Hardware: iPad Mini 6
OS: 26.2
Happ version: 3.7.1
Xray version: 25.12.8

Checklist

  • This question is written entirely in English.
Originally created by @janusn on GitHub (Jan 5, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3632 ### Question I have recently set up a 2x-ui docker container. A Happ client can connect to websites with ip via 3x-ui but DNS query fails. Running nslookup inside the 3x-ui container works fine. How to configure DNS for clients? Thanks in advance. The exported `Inbounds` from WebUI: ``` { "id": 1, "userId": 0, "up": 0, "down": 0, "total": 0, "allTime": 0, "remark": "Hunny", "enable": true, "expiryTime": 0, "trafficReset": "never", "lastTrafficResetTime": 0, "listen": "", "port": 443, "protocol": "vless", "settings": "{\n \"clients\": [\n {\n \"comment\": \"\",\n \"created_at\": 1767481002000,\n \"email\": \"john doe\",\n \"enable\": true,\n \"expiryTime\": 0,\n \"flow\": \"xtls-rprx-vision\",\n \"id\": \"<<REDACTED>>\",\n \"limitIp\": 0,\n \"reset\": 0,\n \"subId\": \"<<REDACTED>>\",\n \"tgId\": 0,\n \"totalGB\": 0,\n \"updated_at\": 1767481002000\n },\n ],\n \"decryption\": \"none\",\n \"encryption\": \"none\",\n \"fallbacks\": [\n {\n \"alpn\": \"\",\n \"dest\": \"10.27.0.203:443\",\n ],\n \"testseed\": [\n 900,\n 500,\n 900,\n 256\n ]\n}", "streamSettings": "{\n \"network\": \"tcp\",\n \"security\": \"reality\",\n \"externalProxy\": [],\n \"realitySettings\": {\n \"show\": false,\n \"xver\": 0,\n \"target\": \"apple.com:443\",\n \"serverNames\": [\n \"Apple.com\",\n \"www.apple.com\"\n ],\n \"privateKey\": \"<<REDACTED>>\",\n \"minClientVer\": \"\",\n \"maxClientVer\": \"\",\n \"maxTimediff\": 0,\n \"shortIds\": [\n \"<<REDACTED>>\",\n \"<<REDACTED>>\",\n \"<<REDACTED>>\",\n \"<<REDACTED>>\",\n \"<<REDACTED>>\",\n \"<<REDACTED>>\",\n \"<<REDACTED>>\",\n \"<<REDACTED>>\"\n ],\n \"mldsa65Seed\": \"<<REDACTED>>\",\n \"settings\": {\n \"publicKey\": \"<<REDACTED>>\",\n \"fingerprint\": \"chrome\",\n \"serverName\": \"\",\n \"spiderX\": \"/\",\n \"mldsa65Verify\": \"<<REDACTED>>\"\n }\n },\n \"tcpSettings\": {\n \"acceptProxyProtocol\": false,\n \"header\": {\n \"type\": \"none\"\n }\n }\n}", "tag": "inbound-443", "sniffing": "{\n \"enabled\": false,\n \"destOverride\": [\n \"http\",\n \"tls\",\n \"quic\",\n \"fakedns\"\n ],\n \"metadataOnly\": false,\n \"routeOnly\": false\n}", "clientStats": [ { "id": 1, "inboundId": 1, "enable": true, "email": "john doe", "uuid": "<<REDACTED>>", "subId": "<<REDACTED>>", "up": 0, "down": 0, "allTime": 0, "expiryTime": 0, "total": 0, "reset": 0, "lastOnline": 0 } ] } ``` The content of the `All` textbox from `XRay Configs`->`Advanced` ``` { "log": { "access": "/var/log/xray/access.log", "dnsLog": false, "error": "/var/log/xray/error.log", "loglevel": "warning", "maskAddress": "" }, "api": { "tag": "api", "services": [ "HandlerService", "LoggerService", "StatsService" ] }, "inbounds": [ { "tag": "api", "listen": "127.0.0.1", "port": 62789, "protocol": "tunnel", "settings": { "address": "127.0.0.1" } } ], "outbounds": [ { "tag": "direct", "protocol": "freedom", "settings": { "domainStrategy": "AsIs", "redirect": "", "noises": [] } }, { "tag": "blocked", "protocol": "blackhole", "settings": {} } ], "policy": { "levels": { "0": { "statsUserDownlink": true, "statsUserUplink": true } }, "system": { "statsInboundDownlink": true, "statsInboundUplink": true, "statsOutboundDownlink": false, "statsOutboundUplink": false } }, "routing": { "domainStrategy": "AsIs", "rules": [ { "type": "field", "inboundTag": [ "api" ], "outboundTag": "api" }, { "type": "field", "outboundTag": "blocked", "ip": [ "geoip:private" ] }, { "type": "field", "outboundTag": "blocked", "protocol": [ "bittorrent" ] } ] }, "stats": {}, "metrics": { "tag": "metrics_out", "listen": "127.0.0.1:11111" } } ``` `compose.yaml` ``` --- services: 3x-ui: image: ghcr.io/mhsanaei/3x-ui:latest container_name: 3x-ui hostname: nuc13-3x-ui deploy: resources: limits: memory: 512M environment: TZ: "Europe/London" XRAY_VMESS_AEAD_FORCED: "false" XUI_ENABLE_FAIL2BAN: "false" volumes: - ./config/db/:/etc/x-ui/:rw - ./cert/:/root/cert/:rw - /mnt/tank/logs/3x-ui/:/var/log/:rw tty: true ports: - "2054:2054" - "443:443" - "443:443/udp" logging: driver: json-file options: max-size: 100m max-file: 10 restart: unless-stopped ``` `access.log` ``` 2026/01/05 09:29:28.002056 from 127.0.0.1:43608 accepted tcp:127.0.0.1:62789 [api -> api] 2026/01/05 09:29:38.002474 from 127.0.0.1:51126 accepted tcp:127.0.0.1:62789 [api -> api] 2026/01/05 09:29:48.001438 from 127.0.0.1:54964 accepted tcp:127.0.0.1:62789 [api -> api] ... 2026/01/05 09:41:08.001855 from 127.0.0.1:53928 accepted tcp:127.0.0.1:62789 [api -> api] 2026/01/05 09:41:18.002547 from 127.0.0.1:40240 accepted tcp:127.0.0.1:62789 [api -> api] 2026/01/05 09:41:28.002276 from 127.0.0.1:54878 accepted tcp:127.0.0.1:62789 [api -> api] ``` `error.log` ``` 2026/01/04 14:57:25.922494 [Warning] core: Xray 25.12.8 started ``` **Client:** Hardware: iPad Mini 6 OS: 26.2 Happ version: 3.7.1 Xray version: 25.12.8 ### Checklist - [x] This question is written entirely in English.
bsakaguchi 2026-10-31 20:25:31 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@janusn commented on GitHub (Jan 5, 2026):

I have installed Happ in macOS 26 now. Additional information from terminal ran on macOS client:

$ curl -vvvv https://google.com
* Could not resolve host: google.com
* Closing connection
curl: (6) Could not resolve host: google.com
<!-- gh-comment-id:3711943759 --> @janusn commented on GitHub (Jan 5, 2026): I have installed Happ in macOS 26 now. Additional information from terminal ran on macOS client: ``` $ curl -vvvv https://google.com * Could not resolve host: google.com * Closing connection curl: (6) Could not resolve host: google.com ```
Author
Owner

@janusn commented on GitHub (Jan 8, 2026):

I have noted that:

$ grep nameserver <(scutil --dns)

  nameserver[0] : 10.27.0.201
  nameserver[1] : 10.27.0.193
  nameserver[0] : 10.27.0.201
  nameserver[1] : 10.27.0.193
$ dig 3x-ui.example.com @10.27.0.201

; <<>> DiG 9.10.6 <<>> 3x-ui.example.com @10.27.0.201
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22217
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;3x-ui.example.com.			IN	A

;; ANSWER SECTION:
3x-ui.example.com.		0	IN	A	10.27.0.202
3x-ui.example.com.		0	IN	A	10.27.0.194

;; Query time: 2 msec
;; SERVER: 10.27.0.201#53(10.27.0.201)
;; WHEN: Wed Jan 07 23:58:14 GMT 2026
;; MSG SIZE  rcvd: 74

$ dig 3x-ui.example.com

; <<>> DiG 9.10.6 <<>> 3x-ui.example.com
;; global options: +cmd
;; connection timed out; no servers could be reached
<!-- gh-comment-id:3721418151 --> @janusn commented on GitHub (Jan 8, 2026): I have noted that: ``` $ grep nameserver <(scutil --dns) nameserver[0] : 10.27.0.201 nameserver[1] : 10.27.0.193 nameserver[0] : 10.27.0.201 nameserver[1] : 10.27.0.193 $ dig 3x-ui.example.com @10.27.0.201 ; <<>> DiG 9.10.6 <<>> 3x-ui.example.com @10.27.0.201 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22217 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ;; QUESTION SECTION: ;3x-ui.example.com. IN A ;; ANSWER SECTION: 3x-ui.example.com. 0 IN A 10.27.0.202 3x-ui.example.com. 0 IN A 10.27.0.194 ;; Query time: 2 msec ;; SERVER: 10.27.0.201#53(10.27.0.201) ;; WHEN: Wed Jan 07 23:58:14 GMT 2026 ;; MSG SIZE rcvd: 74 $ dig 3x-ui.example.com ; <<>> DiG 9.10.6 <<>> 3x-ui.example.com ;; global options: +cmd ;; connection timed out; no servers could be reached ```
Author
Owner

@Frew777 commented on GitHub (Jan 8, 2026):

Have you tried another x-ray client?
You need to figure out whether the problem is in the server settings or the client.

<!-- gh-comment-id:3724794785 --> @Frew777 commented on GitHub (Jan 8, 2026): Have you tried another x-ray client? You need to figure out whether the problem is in the server settings or the client.
Author
Owner

@janusn commented on GitHub (Mar 10, 2026):

I am sorry for the late reply.

I have solved the issue by correct settings in 3x-ui. Thank you very much.

<!-- gh-comment-id:4031237542 --> @janusn commented on GitHub (Mar 10, 2026): I am sorry for the late reply. I have solved the issue by correct settings in 3x-ui. Thank you very much.
Author
Owner

@slaveofmoney commented on GitHub (Jul 3, 2026):

I am sorry for the late reply.

I have solved the issue by correct settings in 3x-ui. Thank you very much.

Could you share the solution? I’m having the same problem: iPhone clients connect, but DNS doesn't work.

<!-- gh-comment-id:4879331821 --> @slaveofmoney commented on GitHub (Jul 3, 2026): > I am sorry for the late reply. > > I have solved the issue by correct settings in 3x-ui. Thank you very much. Could you share the solution? I’m having the same problem: iPhone clients connect, but DNS doesn't work.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#2439
No description provided.