Root Shell command to Clear DNS Cache in Lollipop?

こ雲淡風輕ζ 提交于 2019-12-07 04:51:17

问题


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.


回答1:


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

ndc resolver flushnet <iface>




回答2:


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


来源:https://stackoverflow.com/questions/32442365/root-shell-command-to-clear-dns-cache-in-lollipop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!