Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to Check if a Website Is Down: HTTP Status Codes, DNS, cURL and Real-Time Monitoring

When a website stops loading, the first question is usually: Is the website actually down or is something wrong with my connection? For developers, diagnosing availability issues requires more than refreshing a browser. A website can fail because of DNS resolution problems, web server errors, network routing issues, SSL certificate problems or even a local browser configuration. In this guide,…

Two DNS blunders often lead to outbound mail being routed to the spam folder: having multiple SPF records for a single domain. The SPF spec only permits a single v=spf1 TXT record. When there are two, mail receivers return a permerror, and many interpret this as a failure. Without a DMARC record under the _dmarc domain, receivers lack any policy from the domain owner and receive no reports.

You can verify both SPF and DMARC from your codebase in mere minutes, using a public DNS-over-HTTPS (DoH) resolver that delivers JSON responses.

To begin, install curl, which is pre-installed on macOS, Linux, and Windows 10+. For JavaScript, Node.js version 18 or later is required (built-in fetch() function). Python users need to install the requests library via pip.

First, perform a curl request to Cloudflare's DoH endpoint to retrieve the domain's DMARC record. The request includes the accept: application/dns-json header to request JSON format instead of binary DNS. The response includes a JSON object with the DMARC record's details, including the v=DMARC1; p=quarantine; sp=reject; pct=100; rua=mailto:dmarc@github.com; ruf=mailto:dmarc@github.com; fo=1 data.

Next, check for SPF records using JavaScript. Save the script as check.mjs and run it with Node.js. The script defines a txt() function that sends a curl request to the DoH endpoint for a TXT record at the specified domain. The function filters the returned records to find those starting with v=spf1. For the domain github.com, the output indicates one valid SPF record, while the DMARC record is present as expected.

The Python version of the script, check.py, follows a similar process. It imports the requests library, defines a txt() function that sends a GET request to the DoH endpoint with the appropriate parameters. The function parses the JSON response and filters for TXT records starting with v=spf1. The github.com domain check shows one valid SPF record and the correct DMARC record.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in Tech

What about 630 website checks showed me in the first week, and what they cannot show

I build DeployVet, a free tool that does a website security and bug check from the outside and grades the site A to F. I wanted to share what the numbers look like after the first week, and be clear…

  • DeployVet conducted 645 security checks on 633 unique websites in its first week of operation.
  • 41% of domains received an A or B grade, while 59% received a C, D, or F grade.

GXVK: 3Dfx Glide API Implemented Atop Vulkan For Modern Usage

The open-source D7VK project that implements the Direct3D 7 / 6 / 5 / 3 APIs atop the Vulkan API for faster, modern performance is out with a new release. This new D7VK 2.4 release came as a bit of a surprise since it was just last month D7VK announced its maturity status and more or less in maintenance mode.

More from Thursday 29 October →