Existing city-level target IP geolocation method based on network topology heuristic clustering (HC-Based method) clusters IP nodes by simple voting rules, which is liable to cause a lot of errors in geolocation results. This paper presents a city-level IP geolocation method based on network node clustering, referred to as the NNC method. This method firstly uses the principle that the same network community locates in the same metropolitan area network. Considering the characteristics of the module that can accurately measure the strength of the network community structure, the network topology is clustered based on the modular optimization, and the network community with the highest module degree is obtained. Then the IP geography database voting rules is used to determine the location of the network community. Finally, depending on the network community where the target IP is located in, the city where the target IP is located in can be determined. Experimental results of 15 000 Internet IP nodes in five provinces (Henan, Shandong, Shaanxi, Guangdong and Zhejiang) of China show that compared with HC-Based method, the proposed method can significantly improve the accuracy and recall rate of the target IP, and reduce the effect of the inaccurate landmarks on the location results.