This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

hi, so im trying to make a little programm that can get the ip of a server and display it, kinda like you can do in a terminal, just with a textedit where you put in the servers name and it gives you the ip.

image: https://ibb.co/9GCMm1z (the highlightet part is the ip i want to get in godot)

if someone knows, is it possible to also locate the ip from the server directly in godot?

Godot version 3.3
in Engine by (224 points)

1 Answer

0 votes

Is this what you want?

var ip = IP.resolve_hostname("google.com")
print(ip)

Here, that prints 142.250.72.14, which matches the IP returned by ping google.com in my case.

by (22,704 points)

Yes! Thanks, couldnt find anything on google. Do you know if its also possible to locate the ip directly in godot like these ip finder websites?

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.