Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Root Shell command to Clear DNS Cache in Lollipop?

I've searched high and low for an answer to this with no luck. Please forgive me if this has been addressed before.

Until a month ago I was on KitKat on an old phone. Then I upgraded to the Nexus 6 with Lollipop. I'm currently on Android 5.1.1. When I was on KitKat on my old phone, I was able to run the shell command with root below to clear my phone's DNS cache:

ndc resolver flushdefaultif

Whenever I would run that command on KitKat, it would always output:

Resolver command succeeded.

But since being on Lollipop, running that same command always outputs:

500 0 Resolver command unknown.

I've even tried running the command:

ndc resolver flushif wlan0

and it outputs the same "Resolver command unknown" as with the other command.

Does anyone happen to know what the proper root shell command to clear Android DNS cache is on Lollipop? Because it appears that the old command I've been using isn't doing the job.

like image 426
Mister Pyrrhuloxia Avatar asked Sep 07 '15 15:09

Mister Pyrrhuloxia


People also ask

What is the command to clear DNS cache?

To Flush the DNS Cache: Type 'ipconfig /flushdns' in the Command Prompt, and press Enter. 3. The user has now flushed the DNS Cache and will receive a message that they have successfully done so. 4.

How do you clear DNS cache Linux?

The easiest way to flush the DNS on Linux, if you are using systemd-resolved, is to use the “systemd-resolve” command followed by “–flush-caches”. Alternatively, you can use the “resolvectl” command followed by the “flush-caches” option.


1 Answers

Looks like it changed yet AGAIN for 7 Nougat:

ndc resolver clearnetdns <netId>

netId being the interface:

ndc resolver clearnetdns wlan0
200 0 Resolver command succeeded
like image 178
Mach Seven Avatar answered Sep 30 '22 19:09

Mach Seven