Shell network restrictions

Hi,

I want to develop a Python script to determine my public IP, but I am facing with trouble. I guess that’s because of network restrictions. Is there a way to solve this issue?
I use the below shell command for the query:

dig +short myip.opendns.com @resolver1.opendns.com

I get back this answer from the shell:

~/queryIPpy$ dig +short myip.opendns.com @resolver1.opendns.com
;; communications error to 208.67.222.222#53: timed out
;; communications error to 208.67.222.222#53: timed out
;; communications error to 208.67.222.222#53: timed out
;; no servers could be reached

Replhttps://replit.com/@LantosSlimbarsz/queryIPpy?v=1

Thanks,
Lantos

are you using firewalledreplit?

Is there any kind of firewalled Repls?
I started with a Python Repl.
I could make some investigation for filtering, but I’m afraid I couldn’t modify it.
My opinion is that Replit restricts network traffics in order to security purposes.

there is a version of replit that does exactly what you referenced:

It’s still owned by replit, but hosted repls cannot access the internet (such as through dns requests).

Replit blocks all DNS traffic to all resolvers other than 1.1.1.3 for safety, try using https://api.ipify.io/ instead of that.

1 Like