It depends on your purpose. Suppose you use free tools to track IP addresses. There is no specific law against this. But, It would be illegal for a DDoS attack.