#๐Ÿ”’ need help with domain pinger

13 messages ยท Page 1 of 1 (latest)

split nebula
#
import subprocess

for number in range(1,21):
    domains_ip = subprocess.run(f"ping lbsg.sm{number}.net", shell=True, capture_output=True, text=True)
    print(domains_ip)```
How do I make my program ping all of these domains and send their IP at once without it taking forever to individually ping each and every domain?

I play minecraft and I'm trying to make a domain pinger that sends the IP of all of these mc servers so I can join Minecraft via them without having to join the server through the lobby
open nymphBOT
#

@split nebula

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

crimson jay
#

A faster way would be to create the ICMP packets yourself using sockets and struct, or a library like Scapy.

#

Although, this way, you may need to do the DNS resolution yourself. I can't remember if Scapy can handle that for you automatically.

split nebula
crimson jay
split nebula
#

thank you

crimson jay
#

You could also start the processes in a non-blocking manner too, or using a thread pool.

open nymphBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.