There’s nothing illegal about looking up IP addresses. If it were illegal, many services like web analytics or targeted advertising would be against the law.