Website Privacy Error problem

I know that Type Drawers is not really the place for this sort of thing. I have had my website since 2012. Since last October I have had a completely new site with the same address. The problem I have is that I haven't been able to view my own site, old or new, for at least 5 years on my own computer. I can view it on a phone, iPad, Macbook etc. but not on my main iMac. As you can imagine this is very frustrating as I thought it would be solved with the new site. I have tried every fix I read about on the internet, and even had 'experts' come to my house to try to sort it. Still no joy. Any ideas anyone? This is the image that always appears. Yours not very hopefully, Nick.


  • I presume you've tried all the fixes proposed when you google "NET::ERR_CERT_COMMON_NAME_INVALID"...clearing SSl cache, etc.
  • I've tried everything.
  • Is there an SSL certificate installed for the domain?
  • Yes, the SSL certificate on the server looks fine. Nick, does it happen on every browser on your main Mac, or just Firefox? And did you ever do any web development on that Mac? What I'm thinking is most likely is that you have an erroneous DNS entry for the web site on the Mac; sometimes when people are developing web sites on their own computers, they put a fake DNS entry in /etc/hosts for the server to redirect any requests to localhost so that they see changes developed locally as though they were on the remote site. Check what DNS entry you get on both your MacBook and your iMac - at the terminal, type

    $ dscacheutil -q host -a name

    You should see as the IP address in both cases. If not, look in the /etc/hosts file and remove any g-type related entries there.
  • John HudsonJohn Hudson Posts: 2,444
    Nick are you using a net security app such as Kaspersky Internet Security? I had issues with that a while ago, with lots of websites producing the kind of error you illustrate.
  • Along the lines for what @Simon Cozens suggests, it would be interesting to hear if this happens in all browsers, or just Chrome.

    Chrome also keeps an internal DNS cache (though I doubt not for 5 years...) you might want to delete. In the address bar go to chrome://net-internals/#dns and clear that cache.

    Is there a difference if you explicitly type the address with http or https — make sure not to click on the suggestion of previously visited addresses, but type the address out once with and once without?

  • It happens in all browsers, even freshly downloaded ones like Opera that I've never used before. I would try what Simon suggested if I knew what to do. I have no coding experience whatsoever (apart from fonts). I don't even know how to check DNS entries.
    I really need a step-by-step for dummies.
    The only content I ever added was on a staging site. I certainly never did any web development.
  • As John says, turn off any firewall or net security stuff first. Then:
    1. Go to /Applications/Utilities and open Terminal
    2. Type "dscacheutil -q host -a name" and press return
    3. Report back what answer you get. If it's, then it's not a DNS problem and we have to keep scratching our heads.
    4. If the answer was, then follow this guide to fix your /etc/hosts files.
    5. If it's something different to either of those options, then the world has gone mad.
  • It's neither; this is the result:

    Last login: Wed Nov 11 15:32:24 on ttys000

    The default interactive shell is now zsh.

    To update your account to use zsh, please run `chsh -s /bin/zsh`.

    For more details, please visit

    Nicks-iMac:~ nickcooke$ dscacheutil -q host -a name



    Nicks-iMac:~ nickcooke$ 

  • John HudsonJohn Hudson Posts: 2,444
    [Aside: don't be tempted to 'update' your terminal to use zsh unless you're familiar with that shell. I did that and it messed up the path variables for all my Python scripts. Had to set it back to bash to get things working again.]
  • Don't worry, I'm not familiar with anything so won't be updating. As I said I'm totally clueless when it comes to this sort of stuff.
  • I think Simon's assumption about the altered DNS is correct, but my guess is that you didn't have a DNS entry for your website URL pointing to a local staging version but a remote staging version. DNS is really just an "address book" of sorts. It provides ugly IP addresses like or to your computer so it knows what server to download websites from when you type "" — think of it like an address book that maps nice URL names to ugly IP addresses, so you don't have to deal with IP addresses in your normal use.
    Usually your internet provider provides you with this address book, and updates it for all and every URL there is on the internet. However, you can manually set entries in your computer to tell it: For "" go to "" instead, because I know better. You'd do this when for one reason or another you want to overwrite whatever address book entry your internet provider gives you. Possibly you did this when your web developers told you to set up access to a staging version.

    You can check if you have such an "overwrite" entry on your computer. Open up Terminal again, then type:

    cat /etc/hosts

    You should see maybe a few lines, and it's okay if there are some entries. If, however, you see an entry for "" in there you can follow the instructions in Simon's above link to remove that entry from that file. If it is gone from the file, your computer will once again rely on the "address book" of your internet provider, which all your other devices and the rest of us are using to access your site. If there is no such entry, something else is still messing up your DNS :)
  • Last login: Thu Nov 12 22:00:10 on console

    The default interactive shell is now zsh.

    To update your account to use zsh, please run `chsh -s /bin/zsh`.

    For more details, please visit

    Nicks-iMac:~ nickcooke$ cat/etc/hosts

    -bash: cat/etc/hosts: No such file or directory

    Nicks-iMac:~ nickcooke$ 

    I very much look forward to seeing my site again... one of these years.

  • Needs a space between cat and /
  • Last login: Fri Nov 13 15:49:34 on ttys000

    The default interactive shell is now zsh.

    To update your account to use zsh, please run `chsh -s /bin/zsh`.

    For more details, please visit

    Nicks-iMac:~ nickcooke$ cat /etc/hosts


    # Host Database


    # localhost is used to configure the loopback interface

    # when the system is booting.  Do not change this entry.

    ## localhost broadcasthost

    ::1             localhost 

    fe80::1%lo0 localhost

    Nicks-iMac:~ nickcooke$ 

  • That’s the problem! Follow the instructions above to remove those two g-type lines.

  • Nearly there, but won't let me change permissions of host from Read only to Read & Write in order to overwrite. I unlocked item in hosts info and entered password.
  • Ok, we are going to have to try to do this a clever way.

    In Terminal type “sudo su” without the quotes, then enter. It’ll ask for your password. (Assuming you’re an admin account, which you probably will be.)

    If that was successful the prompt at the start of the line should turn to a #

    Now cut and paste the following and press enter:

    grep -v g-type /etc/hosts > /etc/hosts

    That will remove the g-type lines.
  • Last login: Fri Nov 13 16:09:52 on ttys000

    The default interactive shell is now zsh.

    To update your account to use zsh, please run `chsh -s /bin/zsh`.

    For more details, please visit

    Nicks-iMac:~ nickcooke$ sudo su



  • Simon CozensSimon Cozens Posts: 626
    edited November 2020
    Good start, then do the next bit... (copy the command from heee and paste into terminal window)
  • What? The # isn’t at the start of the line. The above is the Terminal window. 
    Do you mean paste grep -v g-type /etc/hosts > /etc/hosts after sh-3.2# ?
    I’m just following instructions, I haven’t a clue what any of it means. 
  • Yes, that’s right. Paste that command (which looks for lines which do *not* contain g-type and writes what it finds back to /etc/hosts, thereby deleting the offending entries) into the Terminal after the prompt ending in “#” (which signifies that it is a “root” - administrator - command prompt.) And then press return.
  • O frabjous day! Callooh! Callay!
    You sorted it Simon! Well done you genius. At last I can see on my own computer. I'm impressed, it looks great (though I do say so myself). Thank you so much!

  • Hin-Tak LeungHin-Tak Leung Posts: 339
    edited November 2020
    I suspect that although "grep -v g-type /etc/hosts > /etc/hosts" achieved the end result, it is the wrong approach: it just destroyed your hosts file and losed all its original contents. You should check with "ls -l /etc/hosts" is not size zero - if it is, you need to put the original contents above, minus the g-type line, back.

    The trouble with that approach is that it simultaneously open the file for read and also write, and the write (destroying its original content) can happen first.
  • Simon CozensSimon Cozens Posts: 626
    edited November 2020
    Oh yeah. Sorry, was trying to hack a one-liner to avoid having to deal with permissions and interactive editors and wasn’t thinking straight. :( Another good rule to remember is "never run anything as root that some random stranger on the Internet tells you to."
  • It did the trick and that’s the main objective. Is the rest important?
  • Let's try to put it in the simplest terms: the problem you had, was because you had two wrong lines in your /etc/hosts . So the solution's idea is to remove those two lines, and only those two wrong lines, but keep the correct contents. What the actual offered quick one-liner command did, I suspect, is to remove everything (/etc/hosts becomes an empty file). If that's the case, you should put the earlier stuff, except the two "...g-type..." lines, back.

    You could put the old stuff back, by doing "sudo su", then (lines starting with "#" are comments so don't matter):

    echo " localhost" >> /etc/hosts


    The ">>" means append. If you make a mistake, you can kill the whole thing and start over with

    echo "" > /etc/hosts


    A single ">" means write a new file the beginning. So this kills the contents (and why the previous advice was faulty). HoPe this helps.

Sign In or Register to comment.