How to find all IPs bound to a machine that are not hosting

How to choose a hosting service, how to install your site on it. Discussion, ideas and problems with hosting.
  • Advertisement

How to find all IPs bound to a machine that are not hosting

Postby Graham » Mon Nov 12, 2012 7:33 am

How to find all IPs bound to a machine that are not hosting sites

How to find all IPs bound to a machine that are not hosting sites

This command can be used to find free IPs on a non-panel Linux server.

echo System has $(ifconfig | grep “inet addr:” | grep -v 127.0.0.1 | awk ‘{print $2}’ | sed s/”addr:”// | sort -n > /tmp/boundips && cat /usr/local/apache/conf/httpd.conf | grep “”$// | sed s/”>”$// | sort -n | uniq > /tmp/usedips && diff /tmp/boundips /tmp/usedips | sed -n /^”< “/p | sed s/^”< “// | wc -l) free IPs: && diff /tmp/boundips /tmp/usedips | sed -n /^”< “/p | sed s/^”< “// && rm -f /tmp/boundips /tmp/usedips

Note: On a cPanel server, there is a tool called “Rebuild the IP address pool”, which performs the same function.
Graham
Posting Frequency
Posting Frequency
 
Posts: 1030
Joined: Sun Nov 11, 2012 3:24 am

Advertisement

How to find all IPs bound to a machine that are not hosting

Return to Hosting


Link to: How to find all IPs bound to a machine that are not hosting
URL:
BBCODE:
HTML:

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

 ® PcLayer.com 2009-2012 ©   All Rights Reserved