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

How do I mass delete IPs I no longer use on the server (secondary assignment, not prime subnet)

For example I have a specific /27 I want to remove in one shot, instead of one IP at a time via whm delete IPs function

I'm using Cpanel/WHM with Centos 5x

share|improve this question
up vote 1 down vote accepted

You can just edit /etc/ips and rebuild the IP address pool in WHM after you are done.

A simple operation might be:

cat /etc/ips | sed '/^192.168.2/d' > /etc/

.. verify it

mv /etc/ /etc/ips

Not sure on what you have in there in the neighborhood of the subnet you want to remove, so you will probably want to make the regex a bit more precise :)

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.