2dust / v2rayNG

A V2Ray client for Android, support Xray core and v2fly core
https://1.2345345.xyz
GNU General Public License v3.0
32.14k stars 5.03k forks source link

Direct connection custom rules not working when config's domain is not reachable or blocked whiled using the config #3188

Open imkatman opened 4 weeks ago

imkatman commented 4 weeks ago

Expected Behavior

When config cannot connect due to not reachable or blocked config domain, the direct ips/domains defined in custom rules work as normally since they should not be passed through the config for connection

Actual Behavior

The direct ips/domains showing not reachable page on browser

Reproduction Method

  1. Copy content of the V2rayNG/app/src/main/assets/v2ray_config.json file into clipboard
  2. Launch the app
  3. Press + button
  4. Tap Custom Config menu item
  5. Tap Import custom config from Clipboard option
  6. Open Settings
  7. Go to Custom Rules
  8. Add a domain like domain:whatismyipaddress.com into direct domain/ip tab
  9. Save the custom rule
  10. Connect to the imported config
  11. Go to the device's browser
  12. Type the domain in the address bar e.x. https://whatismyipaddress.com

Log Information

--------- beginning of main
06-03 21:39:44.532 12516 12516 D com.v2ray.ang: Observe settings changed: pref_per_app_proxy
06-03 21:39:44.533 12516 12516 D com.v2ray.ang: Observe settings changed: pref_local_dns_enabled
06-03 21:39:44.534 12516 12516 D com.v2ray.ang: Observe settings changed: pref_fake_dns_enabled
06-03 21:39:44.535 12516 12516 D com.v2ray.ang: Observe settings changed: pref_mux_enabled
06-03 21:39:44.536 12516 12516 D com.v2ray.ang: Observe settings changed: pref_fragment_enabled
06-03 21:39:44.537 12516 12516 D com.v2ray.ang: Observe settings changed: pref_auto_update_subscription
06-03 21:39:44.539 12516 12516 D com.v2ray.ang: Observe settings changed: pref_local_dns_port
06-03 21:39:44.540 12516 12516 D com.v2ray.ang: Observe settings changed: pref_vpn_dns
06-03 21:39:44.541 12516 12516 D com.v2ray.ang: Observe settings changed: pref_mux_concurency
06-03 21:39:44.542 12516 12516 D com.v2ray.ang: Observe settings changed: pref_mux_xudp_concurency
06-03 21:39:44.543 12516 12516 D com.v2ray.ang: Observe settings changed: pref_fragment_length
06-03 21:39:44.544 12516 12516 D com.v2ray.ang: Observe settings changed: pref_fragment_interval
06-03 21:39:44.545 12516 12516 D com.v2ray.ang: Observe settings changed: pref_auto_update_interval
06-03 21:39:44.546 12516 12516 D com.v2ray.ang: Observe settings changed: pref_socks_port
06-03 21:39:44.547 12516 12516 D com.v2ray.ang: Observe settings changed: pref_http_port
06-03 21:39:44.549 12516 12516 D com.v2ray.ang: Observe settings changed: pref_remote_dns
06-03 21:39:44.550 12516 12516 D com.v2ray.ang: Observe settings changed: pref_domestic_dns
06-03 21:39:44.551 12516 12516 D com.v2ray.ang: Observe settings changed: pref_delay_test_url
06-03 21:39:44.552 12516 12516 D com.v2ray.ang: Observe settings changed: pref_speed_enabled
06-03 21:39:44.554 12516 12516 D com.v2ray.ang: Observe settings changed: pref_confirm_remove
06-03 21:39:44.555 12516 12516 D com.v2ray.ang: Observe settings changed: pref_start_scan_immediate
06-03 21:39:44.556 12516 12516 D com.v2ray.ang: Observe settings changed: pref_prefer_ipv6
06-03 21:39:44.789 12516 12539 W com.v2ray.ang: Cleared Reference was only reachable from finalizer (only reported once)
06-03 21:40:16.426 12516 12516 I com.v2ray.ang: Settings ViewModel is cleared
06-03 21:40:18.029 12954 12954 I GoLog   : loading core config
06-03 21:40:18.030 12954 12981 I GoLog   : Preparing Domain: v2ray.cool:10086
06-03 21:40:18.036 12954 12954 I GoLog   : new core
06-03 21:40:18.036 12954 12954 I GoLog   : start core
06-03 21:40:18.039 12954 12982 I GoLog   : [Warning] core: Xray 1.8.11 started
06-03 21:40:18.074 12954 12954 D com.v2ray.ang: [/data/app/~~d9L8nbhFK0gyBDSga-vF_g==/com.v2ray.ang-bmkO46k5xQ3NNSdbm1b8mw==/lib/x86_64/libtun2socks.so, --netif-ipaddr, 26.26.26.2, --netif-netmask, 255.255.255.252, --socks-server-addr, 127.0.0.1:10808, --tunmtu, 1500, --sock-path, sock_path, --enable-udprelay, --loglevel, notice]
06-03 21:40:18.077 12954 12954 D com.v2ray.ang: Process[pid=12990, hasExited=false]
06-03 21:40:18.078 12954 12954 D com.v2ray.ang: /data/user/0/com.v2ray.ang/files/sock_path
06-03 21:40:18.107 12954 12992 D com.v2ray.ang: libtun2socks.so check
06-03 21:40:18.158 12954 12994 D com.v2ray.ang: sendFd tries: 0
06-03 21:40:18.194 12954 12981 I GoLog   : udp:127.0.0.1:59963 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:18.200 12954 12982 I GoLog   : Dial pending prepare  ... v2ray.cool:10086
06-03 21:40:18.225 12954 12981 I GoLog   : Dial pending prepare  ... v2ray.cool:10086
06-03 21:40:18.225 12954 12982 I GoLog   : udp:127.0.0.1:59151 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:18.288 12954 12979 I GoLog   : Prepare Result:
06-03 21:40:18.288 12954 12979 I GoLog   :  Domain: v2ray.cool
06-03 21:40:18.288 12954 12979 I GoLog   :  Port: 10086
06-03 21:40:18.288 12954 12979 I GoLog   :  IPs: [188.114.96.6 188.114.97.6 2a06:98c1:3121::6 2a06:98c1:3120::6]
06-03 21:40:18.353 12954 12982 I GoLog   : tcp:127.0.0.1:43840 accepted tcp:1.1.1.1:853 [socks >> proxy]
06-03 21:40:25.720 12954 13040 I GoLog   : udp:127.0.0.1:60246 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:25.720 12954 13040 I GoLog   : udp:127.0.0.1:51922 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:25.727 12954 13041 I GoLog   : udp:127.0.0.1:55947 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:25.727 12954 13041 I GoLog   : udp:127.0.0.1:37594 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:25.772 12954 13044 I GoLog   : udp:127.0.0.1:60214 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:25.773 12954 13044 I GoLog   : udp:127.0.0.1:33986 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:26.732 12954 13043 I GoLog   : udp:127.0.0.1:56687 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:26.733 12954 13043 I GoLog   : udp:127.0.0.1:44707 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:26.733 12954 13043 I GoLog   : udp:127.0.0.1:47110 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:26.735 12954 13049 I GoLog   : udp:127.0.0.1:34142 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:26.789 12954 13050 I GoLog   : udp:127.0.0.1:40531 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:26.789 12954 13050 I GoLog   : udp:127.0.0.1:39337 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:27.631 12954 13050 I GoLog   : udp:127.0.0.1:50022 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:27.632 12954 13053 I GoLog   : udp:127.0.0.1:57421 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:27.647 12954 13054 I GoLog   : udp:127.0.0.1:45849 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:27.649 12954 13050 I GoLog   : udp:127.0.0.1:54829 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:27.649 12954 13050 I GoLog   : udp:127.0.0.1:36029 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:27.649 12954 13050 I GoLog   : udp:127.0.0.1:43136 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:28.235 12954 13058 I GoLog   : udp:127.0.0.1:42448 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:28.647 12954 13059 I GoLog   : udp:127.0.0.1:45978 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:28.647 12954 13059 I GoLog   : udp:127.0.0.1:46996 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:28.664 12954 13063 I GoLog   : udp:127.0.0.1:51296 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:28.664 12954 13063 I GoLog   : udp:127.0.0.1:36244 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:28.664 12954 13063 I GoLog   : udp:127.0.0.1:53377 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:28.664 12954 13063 I GoLog   : udp:127.0.0.1:57899 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:28.758 12954 13061 I GoLog   : udp:127.0.0.1:34424 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:28.815 12954 13069 I GoLog   : udp:127.0.0.1:49992 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:30.669 12954 13070 I GoLog   : udp:127.0.0.1:38991 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:30.687 12954 13073 I GoLog   : udp:127.0.0.1:54846 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:30.688 12954 13080 I GoLog   : udp:127.0.0.1:38125 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:38.765 12954 13102 I GoLog   : udp:127.0.0.1:41105 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:38.766 12954 13102 I GoLog   : udp:127.0.0.1:44748 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:38.766 12954 13102 I GoLog   : udp:127.0.0.1:40334 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:38.766 12954 13102 I GoLog   : udp:127.0.0.1:58439 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:38.766 12954 13102 I GoLog   : udp:127.0.0.1:48614 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:38.820 12954 13106 I GoLog   : udp:127.0.0.1:60399 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:39.781 12954 13107 I GoLog   : udp:127.0.0.1:52741 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:39.781 12954 13109 I GoLog   : udp:127.0.0.1:38721 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:40.677 12954 13107 I GoLog   : udp:127.0.0.1:44566 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:40.679 12954 13110 I GoLog   : udp:127.0.0.1:38133 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:40.679 12954 13110 I GoLog   : udp:127.0.0.1:45078 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:40.680 12954 13113 I GoLog   : udp:127.0.0.1:39854 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:40.681 12954 13113 I GoLog   : udp:127.0.0.1:49119 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:40.694 12954 13114 I GoLog   : udp:127.0.0.1:60391 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:40.695 12954 13110 I GoLog   : udp:127.0.0.1:48015 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:40.696 12954 13117 I GoLog   : udp:127.0.0.1:46400 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:40.696 12954 13117 I GoLog   : udp:127.0.0.1:48596 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:40.697 12954 13118 I GoLog   : udp:127.0.0.1:60593 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:40.698 12954 13118 I GoLog   : udp:127.0.0.1:38570 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:41.692 12954 13118 I GoLog   : udp:127.0.0.1:42894 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:41.693 12954 13121 I GoLog   : udp:127.0.0.1:59619 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:41.695 12954 13120 I GoLog   : udp:127.0.0.1:33302 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:41.695 12954 13120 I GoLog   : udp:127.0.0.1:49048 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:41.708 12954 13122 I GoLog   : udp:127.0.0.1:43304 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:41.709 12954 13123 I GoLog   : udp:127.0.0.1:59640 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:41.710 12954 13125 I GoLog   : udp:127.0.0.1:47843 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:41.713 12954 13126 I GoLog   : udp:127.0.0.1:35187 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:41.805 12954 13128 I GoLog   : udp:127.0.0.1:43050 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:43.717 12954 13125 I GoLog   : udp:127.0.0.1:41137 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:43.718 12954 13129 I GoLog   : udp:127.0.0.1:38354 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:43.733 12954 13129 I GoLog   : udp:127.0.0.1:56814 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:43.733 12954 13129 I GoLog   : udp:127.0.0.1:59333 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:48.247 12954 13143 I GoLog   : udp:127.0.0.1:50650 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:48.771 12954 13153 I GoLog   : udp:127.0.0.1:42089 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:48.771 12954 13153 I GoLog   : udp:127.0.0.1:47022 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:48.771 12954 13153 I GoLog   : udp:127.0.0.1:55212 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:48.773 12954 13152 I GoLog   : udp:127.0.0.1:43301 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:49.788 12954 13164 I GoLog   : udp:127.0.0.1:51329 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:49.788 12954 13164 I GoLog   : udp:127.0.0.1:41383 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:50.683 12954 13164 I GoLog   : udp:127.0.0.1:60359 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:51.813 12954 13169 I GoLog   : udp:127.0.0.1:48945 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:51.815 12954 13171 I GoLog   : udp:127.0.0.1:45394 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:51.815 12954 13169 I GoLog   : udp:127.0.0.1:45457 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:52.829 12954 13172 I GoLog   : udp:127.0.0.1:34583 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:52.829 12954 13172 I GoLog   : udp:127.0.0.1:51501 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:53.725 12954 13173 I GoLog   : udp:127.0.0.1:58926 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:53.740 12954 13174 I GoLog   : udp:127.0.0.1:47521 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:53.740 12954 13174 I GoLog   : udp:127.0.0.1:39480 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:53.782 12954 13176 I GoLog   : udp:127.0.0.1:45828 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:53.783 12954 13178 I GoLog   : udp:127.0.0.1:39763 accepted udp:8.8.8.8:53 [socks >> proxy]
06-03 21:40:53.817 12954 13177 I GoLog   : udp:127.0.0.1:58257 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:53.832 12954 13177 I GoLog   : udp:127.0.0.1:57848 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:53.832 12954 13177 I GoLog   : udp:127.0.0.1:55504 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:53.836 12954 13182 I GoLog   : udp:127.0.0.1:60521 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:53.836 12954 13182 I GoLog   : udp:127.0.0.1:51133 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:53.838 12954 13182 I GoLog   : udp:127.0.0.1:53798 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:54.789 12954 13185 I GoLog   : udp:127.0.0.1:58565 accepted udp:8.8.4.4:53 [socks >> proxy]
06-03 21:40:54.836 12954 13209 I GoLog   : udp:127.0.0.1:47860 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:54.839 12954 13210 I GoLog   : udp:127.0.0.1:53457 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:54.841 12954 13212 I GoLog   : udp:127.0.0.1:40134 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:54.841 12954 13212 I GoLog   : udp:127.0.0.1:52852 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:54.846 12954 13214 I GoLog   : udp:127.0.0.1:58246 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:54.848 12954 13213 I GoLog   : udp:127.0.0.1:38776 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:54.854 12954 13216 I GoLog   : udp:127.0.0.1:41591 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:56.862 12954 13225 I GoLog   : udp:127.0.0.1:58484 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:56.862 12954 13225 I GoLog   : udp:127.0.0.1:47186 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:56.869 12954 13216 I GoLog   : udp:127.0.0.1:58556 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:40:58.777 12954 13216 I GoLog   : udp:127.0.0.1:43766 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:41:00.861 12954 13234 I GoLog   : udp:127.0.0.1:52377 accepted udp:1.1.1.1:53 [socks >> proxy]
06-03 21:41:02.868 12954 13230 I GoLog   : udp:127.0.0.1:39156 accepted udp:1.1.1.1:53 [socks >> proxy]

Environmental information

Device: Resizable emulator with api 34 App Version: 1.8.25 Branch: Master Last Commit Revision Number: a5287dbadc75904f7029b729aada07bbe3065556

pulsarice commented 3 weeks ago

Seems like a DNS problem. Note that you should put your domain in Direct section of Custom rules as v2rayNG will create both routing rules and DNS rules for that domain (this is very important). I tried these settings with a non-working proxy and a direct domain and it worked (domestic domains defined in Custom rules are working, while other domains fail)

  1. Add your direct domains in Custom rules. (don't edit configs manually)
  2. Enable Local DNS (this will try using Domestic DNS for direct rules and Remote DNS for others)
  3. Make sure that you have defined a working and directly accessible Domestic DNS (it should be different from your Remote DNS server)