Mobile hotspot doesn't work with Rocky Linux 9.2?

Any hints to what I should be looking for welcome.

When I try to use my phone’s wifi hotspot for Rocky Linux 9.2 (GNOME), DNS doesn’t seem to be working. So e.g. “ping 8.8.8.8” works, but “ping google.com” doesn’t. The network connection settings are in default “automatic” values, for both IPv4 and IPv6.

If I connect to my home wifi (cable modem), no issues, DNS works. So the issue doesn’t seem to be whether the laptop’s wifi adapter is working in Rocky Linux.

If I connect to that mobile wifi hotspot from Windows 11 instead (the same laptop), no issues there either, DNS also works. Which suggests the issue isn’t really with the phone’s mobile connection either.

So how should I start debugging this problem with DNS? Could this somehow be related to IPv6 (both are enabled)? I did try to disable IPv6 in Rocky, but that didn’t seem to change anything.

So I just tested the hotspot connection from my phone and it worked just fine. On occasion if I’m connecting to a wifi network, mostly 2.4g connections there is sometimes a delay of a minute or two before dns becomes available. I’m running F37 but it uses NetworkManager the same as Rocky. One thing you might try is on the ipv4 tab change from “automatec dhcp” to “dhcp only” and then enter a dns address manually like 8.8.8.8 then save. This will bypass the carriers dns and use googles.

Setting IPv4 nameservers manually didn’t change anything. Still resolving just doesn’t seem to work, no matter which nameserver I try to use. The nameserver(s) still get displayed in the connection settings, so at least it seems to know which nameserver(s) it is supposed to use. The nameservers are also reachable with ping.

If my Rocky installation has some issue to interact with any nameserver, should it show in some log? However, that still doesn’t explain why it has no issues if I just switch to the home wifi.

Is there some way to debug how my system interacts with the DNS server, to see whether there are some errors where it fails?

Everything seems to be in order, ie. the network configuration lists some DNS servers it received from the ISP, those DNS servers are reachable with ping and they seem to work fine on the same laptop running Windows, or on another laptop running Linux Mint…

…but still DNS lookup just doesn’t work? Trying to find where and why it fails. Should it go to some log if I e.g. ping google.com or try some website on the browser, and it fails to resolve the host name? I don’t get any meaningful errors with nslookup and whatever, besides just “sorry, server is unreachable”.

Till someone provides some better analysis options it seems you have narrowed down the issue to either the hardware or the driver for that hardware on the subject laptop. The command combo “inxi -nn | grep wifi” will tell what driver is being used. The “nmcli” command can be used to list the connection information and tunables with it’s various command option combinations.
“ipp addr” will list your devices and current connections.
“nmcli de sh {devname}” will show more info about the active connection.

It may be that there isn’t a good linux driver for your laptop device. From the phone side do you have the option to select which radio 5G or 2.4G? If so can you try switching to the other band? Can you try tethering directly to the laptop from the phone to see if that works? If your phone is in some power saving mode try disabling and see if that works.

The thing is that wifi (including DNS) works fine with that same wifi adapter, if I connect to my home wifi cable modem instead. That suggests that the adapter works (also in Rocky Linux), but there is now some odd incompatibility or odd DNS issue, when connecting with the mobile phone. Even odder that manually changing the nameserver to something else (e.g. google’s 8.8.8.8/8.8.4.4) doesn’t seem to have any effect.

My main theory at this point is that something blocks DNS interaction when that mobile wifi, could if be the software firewall or selinux or whatever? But why doesn’t it affect the home wifi, only mobile wifi?

Or then I presumed there may be something odd with the IPv6 connectivity (e.g. the mobile phone operator is doing something differently than what Rocky Linux expects), but I would have presumed those issues would have vanished by just disabling IPv6 altogether in the Rocky Linux network settings.

A tough nut to crack…

Do you mean connecting the phone with an USB cable to the laptop and provide the internet connection through that instead? I guess I can try that…

Yes.

I’ve experienced many different connection issues even with well supported devices. In my neighborhood there are over 20 different access points competing for the same limited channels available to the two wifi bands available. Where you are hopefully your cable wifi is stronger than the competition thus the more reliable connection you see. Your phone does not transmit at the same power level as a modem does thus has a high chance of losing the battle with band width. That tied with weak driver support on the laptop side may be the cause of the issue. The rt8189 wifi adapter is known to have issues with linux as an example, you haven’t indicated what you have.
If you drove out into the countryside where you still have cell data service but there are fewer AP’s to compete with your phones signal you may find that you can connect to the phone hotspot.

A clarification: the issue doesn’t seem to be connecting to the phone hotspot. It succeeds and there is an internet connection because I can ping IP-addresses all over the world, like 8.8.8.8 or 8.8.4.4.

The issue specifically is that DNS lookups don’t work for some reason. So IP addresses work fine, host names don’t.

Also, I haven’t noticed difference with this based on where I try it. I have tried it both at my home and at my workplace (the same laptop and phone), and the workplace is definitely uncongested as it is practically on the countryside.

Well, it seems using different nameservers fixes the problem after all.

Earlier I set the different nameservers (e.g. Google’s 8.8.8.8 and 8.8.4.4) into the Wifi Settings / IPv4 DNS, but for some reason the connection was apparently still not using them. So I now just inserted them into /etc/resolv.conf, DNS works.

What is the correct place in Rocky Linux 9 to set the nameservers manually, irrespective to which connection I am using? I presume /etc/resolv.conf is not, isn’t it overwritten all the time?

Still the open question is why my phone’s automatically provided nameservers don’t seem to work correctly in Rocky Linux, while they work in Windows 11 and Linux Mint, but at least I have a workaround available now.

I’ve been doing some research on my own and have found that you can modify the NetworkManager created connections to suit your needs.

The connection keyfiles are created here:
/etc/NetworkManager/system-connections/

Reading this manpage:
nm-settings-keyfile
will give you a primer on how you might edit the file.

Rocky is a server for me so I don’t have any wifi examples. My fedora systems are still based on the outdated and soon to be migrated ifcg format.

Please read this:

Then, as he says Profile - jbkt23 - Rocky Linux Forum

Finally, check how “hotspot” it feeds and/or commands the clients that get stuck.

Managing Resolve.conf was understandable. Reading RH networking guide my eyes glaze over as most of the early discussion is discussing features that are not applicable to simple user use cases. The example hotspot they use assumes you control the networking iface on the hotspot which is not the case with phones.

I didn’t find this in the document. Is this a search term for googling?