Trying to turn on localhost on Sierra made my Mac unable to connect to internet Background

I recently upgraded to macOS Sierra, but couldn't see the typical "it works" page on the local host. 

I followed some instructions online, first I did the following to my httpd.conf file:


Uncommenting from /etc/apache2/httpd.conf

LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
Include /private/etc/apache2/extra/httpd-vhosts.conf
Include /private/etc/apache2/extra/httpd-userdir.conf

Uncomment from /etc/apache2/extra/httpd-userdir.conf

Include /private/etc/apache2/users/*.conf

In my /etc/apache2/users/$USERNAME.conf file I had ProxyPass configured as well, and to get it working again I had to re-uncomment the following from my httpd.conf.

LoadModule proxy_module libexec/apache2/mod_proxy.so
LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so



the instructions gave me a 403 error on localhost instead of page not found error.

with more search finally these instructions did it:

sudo mv httpd.conf httpd.conf.sierra
sudo mv httpd.conf~previous httpd.conf
sudo apachectl restart


Problem

Things went fine for half a day but the next time I turned on my mac I got this error: ping works and git pull etc work. But I cannot visit websites on chrome/safari etc. I rebooted my mac on recovery mode and the internet worked fine on chrome so I know it's not a hardware issue or an ISP issue.

Here is the output of ifconfig -a

lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 16384
    options=1203&lt;RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP&gt;
    inet 127.0.0.1 netmask 0xff000000 
    inet6 ::1 prefixlen 128 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    nd6 options=201&lt;PERFORMNUD,DAD&gt;
gif0: flags=8010&lt;POINTOPOINT,MULTICAST&gt; mtu 1280
stf0: flags=0&lt;&gt; mtu 1280
en0: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
    ether c4:b3:01:d4:dc:d7 
    inet6 fe80::1c4b:b2f5:b346:e9cf%en0 prefixlen 64 secured scopeid 0x4 
    inet 192.168.43.145 netmask 0xffffff00 broadcast 192.168.43.255
    nd6 options=201&lt;PERFORMNUD,DAD&gt;
    media: autoselect
    status: active
en1: flags=963&lt;UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX&gt; mtu 1500
    options=60&lt;TSO4,TSO6&gt;
    ether 6a:00:02:b2:2f:40 
    media: autoselect &lt;full-duplex&gt;
    status: inactive
en2: flags=963&lt;UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX&gt; mtu 1500
    options=60&lt;TSO4,TSO6&gt;
    ether 6a:00:02:b2:2f:41 
    media: autoselect &lt;full-duplex&gt;
    status: inactive
bridge0: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
    options=63&lt;RXCSUM,TXCSUM,TSO4,TSO6&gt;
    ether 6a:00:02:b2:2f:40 
    Configuration:
        id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
        maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
        root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
        ipfilter disabled flags 0x2
    member: en1 flags=3&lt;LEARNING,DISCOVER&gt;
            ifmaxaddr 0 port 5 priority 0 path cost 0
    member: en2 flags=3&lt;LEARNING,DISCOVER&gt;
            ifmaxaddr 0 port 6 priority 0 path cost 0
    nd6 options=201&lt;PERFORMNUD,DAD&gt;
    media: &lt;unknown type&gt;
    status: inactive
p2p0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 2304
    ether 06:b3:01:d4:dc:d7 
    media: autoselect
    status: inactive
awdl0: flags=8943&lt;UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST&gt; mtu 1484
    ether 3e:43:f9:8e:ae:0d 
    inet6 fe80::3c43:f9ff:fe8e:ae0d%awdl0 prefixlen 64 scopeid 0x9 
    nd6 options=201&lt;PERFORMNUD,DAD&gt;
    media: autoselect
    status: active
utun0: flags=8051&lt;UP,POINTOPOINT,RUNNING,MULTICAST&gt; mtu 2000
    inet6 fe80::f765:ed4f:b226:f379%utun0 prefixlen 64 scopeid 0xa 
    nd6 options=201&lt;PERFORMNUD,DAD&gt;


What i have tried

loading chrome shows me this error.


initially both the web proxy (http) and secure web proxy (https) were selected.. deselecting them didn't change much
it works fine now! but the worst part is that I'm not sure why or what fixed it. For reference here is the last two things i did:


I deselected whatever was selected under the proxies tab in network settings
I replaced the contents of my /etc/apache2/httpd.conf with /etc/apache2/httpd.conf.sierra, which for reference can be found here