Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot set up DNS in the X-UI configuration #101

Open
4 tasks done
Nightmarest opened this issue Jan 10, 2023 · 5 comments
Open
4 tasks done

I cannot set up DNS in the X-UI configuration #101

Nightmarest opened this issue Jan 10, 2023 · 5 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@Nightmarest
Copy link

Nightmarest commented Jan 10, 2023

Welcome

  • Yes, I'm using the latest major release. Only such installations are supported.
  • Yes, I'm using the supported system. Only such systems are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, log, etc).

Description of the problem,screencshot would be good

I cannot set up this configuration. I check the official V2RAY documentation, but the config.json installed from your panel, after any "dns: null" changes and further panel restart, just resets the configuration file back

config:


  "dns": {
    "hosts": {
      "baidu.com": "127.0.0.1"
    },
    "servers": [
      {
        "address": "127.0.0.1",
        "port": 53,
        "domains": [
          "geosite:cn"
        ]
      },
      "8.8.8.8",
      "8.8.4.4",
      "localhost"
    ],
    "clientIp": "0.0.0.0",
    "tag": "dns_inbound"
  },

Version of x-ui

$ x-ui version
# Paste output here

x-ui[1407474]: 2023/01/10 16:05:54 x-ui-english 0.2.1.2

x-ui log or xray log

Jan 10 16:05:54 pinguin2.co systemd[1]: x-ui.service: Consumed 4.858s CPU time.
Jan 10 16:05:54 pinguin2.co systemd[1]: Started x-ui Service.
Jan 10 16:05:54 pinguin2.co x-ui[1407474]: 2023/01/10 16:05:54 x-ui-english 0.2.1.2
Jan 10 16:05:54 pinguin2.co x-ui[1407474]: 2023/01/10 16:05:54 INFO - web server run http on [::]:18770
@NidukaAkalanka NidukaAkalanka self-assigned this Jan 13, 2023
@NidukaAkalanka NidukaAkalanka added the documentation Improvements or additions to documentation label Jan 13, 2023
@NidukaAkalanka
Copy link
Owner

Hi there @Nightmarest !

Please refer the following code snippet and customize it according to your dns severs.

"dns": {
    "hosts": {
      "dns.google": [
        "8.8.8.8",
        "8.8.4.4"
      ],
      "dns.pub": "119.29.29.29",
      "dns.alidns.com": "223.5.5.5"
    },"

Use it after the api segment

@Nightmarest
Copy link
Author

Nightmarest commented Jan 13, 2023

Okay. I am try this later

@Nightmarest
Copy link
Author

Nightmarest commented Jan 13, 2023

it does not work

It prevents you from making absolutely NO changes to the file. Even if I want to change the connection settings somewhere, it will roll back everything again

P.S. - Check file json.go

@MrAliSalehi
Copy link

I'm facing the same issue trying to use pi-hole and x-ui together

@SayidHosseini
Copy link

@NidukaAkalanka @Nightmarest @MrAliSalehi
Apparently the config.json file is overridden with the contents of the sqlite database at /etc/x-ui/x-ui.db.

I tried modifying the database directly by installing (apt install sqlite3 on debian based distros) and editing the db:

sqlite3 /etc/x-ui/x-ui.db

UPDATE settings SET value = '
{
HERE PASTE CONTENTS OF CONFIG.JSON
}'
WHERE key = 'xrayTemplateConfig';

I've seen the file change after restarting the x-ui; however the clients don't seem to be using the DNS servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants