New Wifi captive error 204


devalian90

Members
May 21, 2019
25
15
Hi,
I'm experiencing bug on captive wifi, once connected to wifi, it redirect to captive portal, it'll show error 204, error in name resolution. This goes to a few captive wifi, while other phones connect successfully.

Any wifi without captive, connect just fine.
Device is xiaomi mi8, rom is 9.5.17

Anyone have the same issue, any resolution?

Thanks
 
  • Like
Reactions: @Lipezk_047
24742
 
Du you have Adaway installed, or have you replaced the hosts file?

That can cause this if the new hosts file blocks some address.
 
  • Like
Reactions: devalian90
Du you have Adaway installed, or have you replaced the hosts file?

That can cause this if the new hosts file blocks some address.
Thanks for reply. I didn't have any of those. But I do install cloud flare 1111 app before. Tho I didn't have it now.
 
I got that exact fault in one phone on a ferry when connecting to the free WiFi, but not on a second phone.

Later at home I figured out it must have been the hosts file, which caused me other problems also.

But it could have been some other sort of DNS problem.

But I haven't been on the ferry again to test.

Make a copy of your hosts file from within TWRP:

system/etc/hosts

If you change the copys name to hosts.txt you can read it and see what's in it.
 
  • Like
Reactions: devalian90
I got that exact fault in one phone on a ferry when connecting to the free WiFi, but not on a second phone.

Later at home I figured out it must have been the hosts file, which caused me other problems also.

But it could have been some other sort of DNS problem.

But I haven't been on the ferry again to test.

Make a copy of your hosts file from within TWRP:

system/etc/hosts

If you change the copys name to hosts.txt you can read it and see what's in it.
Cool, thanks for the suggestion though. I did it and my hosts file is below
127.0.0.1 localhost
::1 ip6-localhost

Doesn't seems to have hosts file problem...

Maybe it's the underlying miui problem, where it has to go to certain site to redirect but the default site is not allowed by router captive, or something.
 
Cool, thanks for the suggestion though. I did it and my hosts file is below
127.0.0.1 localhost
::1 ip6-localhost

Doesn't seems to have hosts file problem...

Maybe it's the underlying miui problem, where it has to go to certain site to redirect but the default site is not allowed by router captive, or something.

You could try the cloud flare 1111 app and see if it helps, or change the DNS resolver in some other way.

I am not enough of a DNS expert to give you any good ideas, except maybe:

I installed the browser Bromite, which let's you activate cloud flares 1111 resolver within the browser only, not for the whole phone.

(The phone I had the problem on was the Mi Note 2, running probably EU 9.4.26 at the time.)
 
Hmm sadly I didn't have root on my phone, and I don't think 1111 app changed anything as I don't have root. 1111 uses VPN to route dns request only.

So I might think Xiaomi.eu rom accidentally blocked this url?

Anyhow, I wanted to changed hosts file to add dns resolution for the url. But anyway I can replace the file in twrp without root? I mounted system as r/w, but some process didn't let me replace the hosts file...
 
I can replace the hosts file (and other files) without root in my older phones in TWRP.
Just have to mount everything RW in TWRP

I recall some newer phones had some problem with this, don't remember what that was.

I had not heard of "captive wifi", there are various possible problems it seems.

 
Here is something.
I use "https everywhere" in my Firefox browser.

"Similarly, as HTTPS connections cannot be redirected (at least not without triggering security warnings), a web browser that only attempts to access secure websites before being authorised by the captive portal will see those attempts fail without explanation (the usual symptom is that the intended website appears to be down or inaccessible)."
 
Just noticed we had different errors.

Mine was "connection refused".

Yours was "not resolved".
 
Finally I found out the issue. I had private dns setup from previous rom, flashed back to miui. And the settings is gone, I tot its not available for miui. Ended up using 3rd party app to show up the settings and turned it off. It's all working now
 
  • Like
Reactions: cobben
Finally I found out the issue. I had private dns setup from previous rom, flashed back to miui. And the settings is gone, I tot its not available for miui. Ended up using 3rd party app to show up the settings and turned it off. It's all working now

Good for you.

May I ask, what 3rd party app did you use?