• Home
  • Contact
No Result
View All Result
Blogs
  • Home
  • Contact
No Result
View All Result
Blogs
No Result
View All Result

MacOS: Need to Verify DNS Locally Using Hosts on OSX?

admin by admin
October 27, 2023
in Marketing Automation
Share on FacebookShare on Twitter


One of my clients relocated their website to a bulk hosting account. They updated their domain’s DNS settings for the A and CNAME records but were having difficulty determining whether the site was resolving with the new hosting account (new IP Address).

When troubleshooting DNS, keep in mind a few things: Understand how DNS works, understand how your domain registrar works, and understand how your host manages its domain entry.

How DNS Works

When you type a domain into a browser:

  1. The domain is looked up in an Internet name server to locate where the request should be sent to.
  2. In the case of a web domain request (http), a name server will return the IP address to your computer.
  3. Your computer then stores this locally, known as your DNS Cache.
  4. The request is sent to the host, which routes the request internally and presents your site.

How Your Domain Registrar Works

Note: Not every domain registrar actually manages your DNS. I have one client, for example, who registers their domains through Yahoo! Despite appearing to do so in their administration, Yahoo! is just a reseller for Tucows. As a result, when you change your DNS settings in Yahoo!, it can take hours before those changes are updated in the real domain registrar.

When your DNS settings get updated, they are propagated across an array of servers across the Internet. Most of the time, this takes a few seconds to happen. This is one reason why people will pay for managed DNS. Managed DNS companies typically have both redundancy and are incredibly fast… often faster than your domain registrar.

Once the Internet servers are updated, the next time your system makes the DNS request, the IP address where your site is hosted is returned. NOTE: Remember that I said the next time your system makes the request. If you previously requested that domain, the Internet could be up to date, but your local system may be resolving an old IP address based on your DNS Cache.

How Your Host DNS Works

The IP address returned and cached by your local system isn’t typically unique to a single website. A host may have dozens or even hundreds of websites hosted on a single IP Address (typically a server or virtual server). So, when your domain is requested from the IP Address, your host forwards your request to the specific folder location within the server and presents your page.

How to Troubleshoot DNS

Because there are three systems here, there are also three systems to troubleshoot! First, you’ll want to check your local system to see where the IP Address is pointing to in your system:

OSX Terminal Ping

This is done easily by opening a Terminal window and typing:

ping domain.com

Or you can do a specific name server lookup:

nslookup domain.com
Terminal nslookup

If you’ve updated the DNS settings in your domain registrar, then you’ll want to ensure your DNS cache is cleared, and you’ll want to make the request again. To clear your DNS cache in macOS:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
sudo killall mDNSResponderHelper
sudo dscacheutil -flushcache
Terminal Flush DNS Cache

At this point, you can retry the ping or nslookup to see if the domain resolves to a new IP address.

The next step would be to see if the Internet’s DNS servers have been updated. Keep DNSstuff handy for this: you can get a full DNSreport through their platform that’s really good.

If you see the IP address properly displayed across the web and your site is still not showing up, you can bypass the Internet’s servers and tell your system just to send the request directly to the IP Address. You can accomplish this by updating your hosts file and flushing your DNS. To do this, open Terminal and type:

sudo nano /etc/hosts
Terminal Sudo Nano Hosts

Enter your system password and press enter. That will bring up the file directly in Terminal for editing. Move your cursor using your arrows and add a new line with the IP address followed by the domain name.

Terminal Hosts Save File

Press control-o on your keyboard to save the file, then return to accept the filename. Exit the editor by pressing control-x, which will return you to the command line. Don’t forget to flush your cache. If the site doesn’t come up okay, it may be a problem local to your host, and you should contact them and let them know.

Last note: Remember to return your hosts file to its original version. You don’t want to leave an entry that you want to update automatically!

By following these steps, I was able to verify that my the DNS entries in the registrar were up to date, the DNS entries on the Internet were up to date, my Mac’s DNS cache was up to date, and the web host’s DNS was up to date… good to go!



Source link

Related Posts

Inside Google’s Ranking Algorithms: Insights From The DOJ Antitrust Case
Marketing Automation

Inside Google’s Ranking Algorithms: Insights From The DOJ Antitrust Case

You know those moments when you Google something simple—like What temperature should chicken be cooked to?—and instead of getting...

by admin
July 7, 2025
How to prepare for, navigate, and thrive through summer slumps — according to marketing experts
Marketing Automation

How to prepare for, navigate, and thrive through summer slumps — according to marketing experts

Every summer, a familiar shift hits marketing teams. Engagement cools, inboxes slow, and campaign results taper off just as...

by admin
July 7, 2025
Marketing Automation

Open Rates Are Dying: Here’s What Actually Matters Now in Email Marketing

Open rates are dying; here’s what actually matters now in email marketing, largely due to privacy changes from companies...

by admin
July 7, 2025
Why is Wispr Flow different from other dictation apps?
Marketing Automation

Why is Wispr Flow different from other dictation apps?

I'm your stereotypical Apple fangirl. All my devices are Apple, and I love the way the hardware and software...

by admin
July 7, 2025

POPULAR POSTS

  • Scheduling Instagram Reels: The Complete Guide

    Scheduling Instagram Reels: The Complete Guide

    0 shares
    Share 0 Tweet 0
  • How to set up Discord Server Subscriptions + Shops

    0 shares
    Share 0 Tweet 0
  • How to Use Instagram Collab Posts (+ Ideas to Boost Engagement and Reach)

    0 shares
    Share 0 Tweet 0
  • The Best Time to Post on LinkedIn in 2024 (+Heatmap Graph)

    0 shares
    Share 0 Tweet 0
  • How to Add a Link to an Instagram Story (3 Steps + Examples)

    0 shares
    Share 0 Tweet 0

© MarTechs All rights reserved.

Use of these names, logos, and brands does not imply endorsement unless specified. By using this site, you agree to the Privacy Policy

Navigate Site

  • Home
  • About
  • Services
  • Contact

Newsletter Sign Up.

Loading
No Result
View All Result
  • Home
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.