WordPress on localhost redirecting to unknown ip

Hi please check first your wp-config file and see is there is set any homepage url?
if there then change if not then go to website database and edit table ‘wp-options’ where you find siteurl and homepage url then make them same.

You can also check the .htaccess (hidden file in root) also for redirection.

I hope check in wp-config and wp-option(table) will solve your website url issue

Thanks