Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 11 down vote accepted

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.

share|improve this answer
Okay, thanks. Rebooting would be a possibility and then sysctl -a > sysctl_defaults.conf should do the trick. I'll leave this open for some time, maybe somebody else knows a way. If not I'll accept your answer as the correct one. – Fleshgrinder Aug 15 '12 at 20:42
@Fleshgrinder Make sure you're storing the sysctl values somewhere where they aren't being routinely read at boot (like ~/sysctl_defaults.conf) -- Though it doesn't happen often sometimes the default value for a given sysctl knob changes, and you could introduce some accidental strangeness that way. – voretaq7 Aug 15 '12 at 20:59
Thanks, I knew that and I stored them in my home directory as you have proposed. I also made sure that nothing is in /etc/sysctl.d before rebooting. Everything worked like a charm and I think your solution is totally fine. Thanks again for your help. – Fleshgrinder Aug 15 '12 at 21:04

Sysctl Defaults

On CentOS 7, look at


to get the default settings that ship with the OS.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.