Debian – How to reset sysctl to it’s OS defaults

debianresetsysctl

I couldn't find an answer in the man pages for sysctl. My sysctl.conf file is still at it's default state, I'm testing several values and loaded new settings via sysctl -p newsettings.conf. I though it would be sufficient for reseting to do sysctl -p (which means that it reads the values from sysctl.conf). But a fast sysctl -a | grep domain revealed that there are still the old settings.

Any ideas?

Best Answer

As far as I know there is no "undo" for sysctl -- You need to re-enter the default settings (typically /etc/sysctl.conf simply does not specify defaults, so re-reading it won't revert your changes unless there's an explicit setting).

If you do not know your default settings a reboot will get them back, and you can then list them with sysctl -a (store this somewhere for reference). If you have another mostly-identical machine around you can grab the sysctl -a output from that host instead of rebooting.