Search code examples
androidcachingdnsandroid-5.0-lollipoproot

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.


Solution

  • Looking at the source, it appears the command has been updated to

    ndc resolver flushnet <iface>