Network problems - looking for a testing tool

Folks, I need your help please!

Since about 2-3 month I have problems with my Wifi.
I use my phone for ~90% of all surfing. Pixel 7 running Android 16. I have set Adguard as my “private DNS”.
Lately I often get the message "Private DNS server cannot be accessed. I often get this about 10-15 times a day, really annoying!
Also I stream YouTube from my phone to a Chromecast and it’s always losing connection also when this happens.

I already tried different DNS services (Mulvad & Quad9), same.
So it’s either the phone, my Wifi or my provider.

What I wanna do now is let my laptop check the connection.
Therefore I need an app (or script; but would prefer a GUI tbh) that does nothing but ping a server every 10 seconds or so and logs if the connection is successful or not.
I’m aware that there are a lot of network testing tools like nmap or Wireshark but since I have zero experience in this field I would prefer something simple.
Any tips welcome, thanks in advance!

It’s simplistic, but maybe simple is better, and you don’t need anyone’s help.

ping -i 10 www.google.com | tee > output.txt
Change names as needed to diagnose your issue or punish the guilty.

I’ve always liked MTR for those long-running needs: https://www.bitwizard.nl/mtr/ and https://github.com/traviscross/mtr

Available in basically all repos.

Simple is my preferred way and this seems perfect! Already running on my laptop, thank you!

Two more questions: is there an option to show results in terminal also?
And, for sure a dumb question:grinning_face_with_smiling_eyes: What’s the correct way to stop this? Just close the terminal? Worked for the first test at least.

Oh, and a last one: Will Google notice when I ping the page every 10 seconds for a few days?:thinking:
Guess I better use https://endeavouros.com/ :grin:

The ‘tee’ should echo to stdout as well as redirect to the output file, it did on my terminal while I composed the line.

Ctrl-C
I have no idea ;0

Don’t worry, I use Apple instead of Google. I don’t care if Apple blocks me:face_with_hand_over_mouth:

Have you tried setting the DNS on your router?

I have currently Mullvad’s set on the router but I have tried the other two you mentioned before as well. They all have worked.

Also, setting the Private DNS on Android, me too, I have had some connectivity issues but nothing like 10-15 times like you have. Only sporadically.

Nowadays I use https://rethinkdns.com/ on Android.
It is a powerful tool which lets you finetune your connections to a great deal. It takes a little time to configure the way you like it but then you can practically forget about it. It is also quite gentle on the battery. I like it a lot.

The router I currently use is from my provider and doesn’t allow switching DNS.

Like you, I only had this problem sporadically until ~2-3 month ago. My suspicion is indeed the phone/Android.

We’ll see what the network test says. I already had 2 outages on my phone while this is running on my laptop.

That’s a pity!

I would really consider the app I recommended above. You can choose between some DNS providers, Mullvad, Quad9 and AdGuard included. Also you can load a bunch of ad and content blocker into it. More, it works as Firewall and some more.

I haven’t had any issues with my current DNS (Mullvad) configured in this app. It’s open source too.

Alright, enough marketing :sweat_smile:

Thx, I will take a look at this :+1:

My phone (android 16) seems to lose connectivity more than anything else in the house…dunno if that’s your issue or not..but my observation.

If you can afford it, buy a WiFi router from Dlink or Netgear or some reputed brand and connect it to your provider provided router. Disable WiFi and network from your provider provided router and connect it to your personal WiFi router.

Which brand of phone do you have? Also do you have the same issue without the Private DNS setting disabled?

I used my own routers (usually Netgear) in the past but this one works fine, so I didn’t see any reason to replace it so far.

Phone is Google Pixel 7, running the stable branch of Android 16.
And no, the problems just there when I use private DNS.
My suspicion is that Android is trying to contact some server that’s on the blacklist of ad blocking DNS services. Maybe I should try the non blocking version of Quad9 to see if this works.

A little update on this problem:

I let @dbarronoss script run multiple times for several hours. There have been two occasions where the ping wasn’t successful but that’s it. So I’d say that neither the DNS, nor my network or Wifi are the problem.

That leaves my phone.

So I just installed the Linux Terminal app on my phone and tried to run the script there. Seems to work, but the logfile is nowhere to be found.

So I tried

ping -i 10 www.google.com | tee > /storage/emulated/0/Documents/nwtest.txt

but that doesn’t work:

I’m aware that’s more an Android question than a Linux one, but maybe anybody can help here?

Edit: Found the solution! If anyone is curious, you can’t access the phones storage directly via the terminal, you can only access the download folder via /mnt/shared

So the correct command is:

 ping -i 10 www.google.com | tee > /mnt/shared/nwtest.txt

@Mods/Admins: Can you pls leave this thread open for 2 or 3 more days? Thank you!