Instant internet & DNS connectivity check
mynetok.com is a free, lightweight API that tells you whether your internet connection and DNS resolution are working. Make an HTTP request to https://mynetok.com/check.json and get a simple JSON response:
{ "ok": true }
If the request succeeds, your internet and DNS are working. If it fails, they aren't. That simple.
{"ok": true} — confirming end-to-end connectivity.curl -s https://mynetok.com/check.json
fetch("https://mynetok.com/check.json")
.then(r => r.json())
.then(d => console.log(d.ok ? "Online" : "Offline"))
.catch(() => console.log("Offline"));
import urllib.request, json
try:
with urllib.request.urlopen("https://mynetok.com/check.json") as r:
data = json.loads(r.read())
print("Online" if data["ok"] else "Offline")
except Exception:
print("Offline")
resp, err := http.Get("https://mynetok.com/check.json")
if err != nil {
fmt.Println("Offline")
return
}
defer resp.Body.Close()
var result struct{ OK bool `json:"ok"` }
json.NewDecoder(resp.Body).Decode(&result)
if result.OK {
fmt.Println("Online")
}
if curl -sf https://mynetok.com/check.json > /dev/null; then
echo "Online"
else
echo "Offline"
fi
try {
$r = Invoke-RestMethod "https://mynetok.com/check.json"
if ($r.ok) { "Online" } else { "Offline" }
} catch { "Offline" }
require 'net/http'
require 'json'
begin
uri = URI('https://mynetok.com/check.json')
data = JSON.parse(Net::HTTP.get(uri))
puts data['ok'] ? 'Online' : 'Offline'
rescue
puts 'Offline'
end
$json = @file_get_contents("https://mynetok.com/check.json");
$data = $json ? json_decode($json, true) : null;
echo ($data && $data["ok"]) ? "Online" : "Offline";
curl -s https://mynetok.com/check.json in your terminal. If you get back {"ok": true}, your internet connection is working. If the request times out or fails, your internet is down.https://mynetok.com/check.json. Because the request requires resolving the domain name mynetok.com, a successful response proves that your DNS resolution is functioning correctly. You can also run nslookup mynetok.com to test DNS independently.nslookup mynetok.com and internet independently by pinging an IP address directly.https://mynetok.com/check.json from any programming language. If the request succeeds and returns {"ok": true}, connectivity is confirmed. If it throws an exception or times out, the connection is down. See the code examples above for curl, JavaScript, Python, Go, Bash, PowerShell, Ruby, and PHP.https://mynetok.com/check.json at regular intervals from a cron job or monitoring script. If the request fails, trigger an alert. This gives you a simple, dependency-free way to detect when your server or device loses internet connectivity.8.8.8.8 only tests basic IP-level connectivity — it tells you packets can reach Google's DNS server but does not verify that DNS resolution works. mynetok.com tests both DNS and HTTP connectivity in one request, giving a more complete picture of whether your internet is truly functional for real-world use (browsing, API calls, etc.).