advert-block-antix question

Forum Forums New users New Users and General Questions advert-block-antix question

  • This topic has 7 replies, 4 voices, and was last updated Apr 15-3:19 pm by ModdIt.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #81220
    Member
    wildstar84

      I’m in the process of updating my hosts file to the latest advert-block-antix and was wondering why you convert everything to 127.0.0.1 when Steven Black and some others recommend using 0.0.0.0?

      I also noticed that http://hosts-file.net/ad_servers.asp (adlist5) no longer works (doesn’t return anything)!

      Thanks,

      Jim

      #81221
      Member
      sybok
        Helpful
        Up
        0
        ::

        Hi, not a developer, just curious.
        What is the advantage of 0.0.0.0? Could you post some links that provide explanation of the difference?

        #81225
        Member
        ModdIt
          Helpful
          Up
          0
          ::

          Hi all,
          On installations we (moddits) have non valid address. Pls see below for why

          0.0.0.0 address causes a network request to immediately fail, because it’s not a valid or routable address.
          127.0.0.1 localhost address will check if listening on port 80 before failing with ‘connection refused.
          Equivalents for IPV6
          The ipv6 localhost is ::1. The non routable address is ::

          Idea is minimal overhead.

          Used find and replace in Libreoffice to help setup the hosts list which includes some extras to block known telemetry servers in
          best possible manner. Additional Firewall rules in use on top.

          #81242
          Member
          wildstar84
            Helpful
            Up
            0
            ::

            @Moddit – Isn’t that what we want with these blocked hosts (the request to immediately fail)?

            @sybok – From Stephen Black’s (author of a huge amalgamated advert-blocking host system) GitHub page: (https://github.com/StevenBlack/hosts.git):

            ## We recommend using 0.0.0.0 instead of 127.0.0.1
            Traditionally most host files use 127.0.0.1, the *loopback address*, to establish an IP connection to the local machine.

            We prefer to use 0.0.0.0, which is defined as a non-routable meta-address used to designate an invalid, unknown, or non-applicable target.

            Using 0.0.0.0 is empirically faster, possibly because there’s no wait for a timeout resolution. It also does not
            interfere with a web server that may be running on the local PC.

            #81246
            Member
            ModdIt
              Helpful
              Up
              0
              ::

              Reading a long treatice here https://www.howtogeek.com/225487/what-is-the-difference-between-127.0.0.1-and-0.0.0.0/

              Maybe 0.0.0.0 is inapropriate on a machine used as a server. I followed the Steven Black logic without issues,
              I am not running any servers with exception of pi hole. When it works that is. My fault when it does not.!

              #81308
              Member
              Robin
                Helpful
                Up
                0
                ::
                $ sudo ping 0.0.0.0
                PING 0.0.0.0 (127.0.0.1) 56(84) bytes of data.
                64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.048 ms
                64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.056 ms
                64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.064 ms
                64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.063 ms
                ^C
                --- 0.0.0.0 ping statistics ---
                4 packets transmitted, 4 received, 0% packet loss, time 77ms
                rtt min/avg/max/mdev = 0.048/0.057/0.064/0.011 ms
                
                $ sudo traceroute 0.0.0.0
                traceroute to 0.0.0.0 (0.0.0.0), 30 hops max, 60 byte packets
                 1  localhost (127.0.0.1)  0.061 ms  0.020 ms  0.020 ms

                Don’t know what I should think of it…
                What I know about this address is (or better: what I believe to know about it from the old days)
                It is either used to route to any local address, or for signalling to use the default route. And the default route could very well be your network router to internet, depending on your networking setup, I believe. In this case the 0.0.0.0 address doesn’t block anything, while 127.0.0.1 does. But in antiX 0.0.0.0 is obviously rerouted to 127.0.0.1, as you can read from the above command output.

                But now, what is actually faster? Let’s compare:

                $ sudo ping 127.0.0.1
                PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
                64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.049 ms
                64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.061 ms
                64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.063 ms
                ^C
                --- 127.0.0.1 ping statistics ---
                3 packets transmitted, 3 received, 0% packet loss, time 82ms
                rtt min/avg/max/mdev = 0.049/0.057/0.063/0.010 ms
                
                $ sudo traceroute 127.0.0.1
                traceroute to 127.0.0.1 (127.0.0.1), 30 hops max, 60 byte packets
                 1  localhost (127.0.0.1)  0.051 ms  0.014 ms  0.012 ms

                Well, obviously there is no difference at all. Same range of values as the first output.

                Windows is like a submarine. Open a window and serious problems will start.

                #81324
                Member
                wildstar84
                  Helpful
                  Up
                  0
                  ::

                  Thanks for the inputs so far, but I should pbly add a further clarification: I have the blocking hosts file installed on my Linux ROUTER (Clients include both Windows-7, linux, and even an iPad). Correct me if I’m wrong, but I’m guessing that when DNS is requested for a blocked URL, if 127.0.0.1 is returned and the requesting client is running a local webserver, then that webserver will be hit, but if 0.0.0.0 is returned, then no such extra step will occur, however, as @Robin pointed out, pinging one of the blocked URLs (mapped to 0.0.0.0 in the router’s hosts file, returns 127.0.0.1 (on my Antix client at least)!

                  #81355
                  Member
                  ModdIt
                    Helpful
                    Up
                    0
                    ::

                    Please keep this thread on topic, the questions pertain to hosts files with thousands of entrys.
                    A single ping time is of no help to anyone.
                    I am not an authority in the field of relative performance in a real world comparison between urls
                    routed with 0.0.0.0 or 127.0.0.1.
                    The full file from Steven Blacks GitHup repos has 111,000 plus individual entrys.

                    Probably a situation where minimal differences in handling individual urls can affect performance.

                    Sniff google chrome while searching on an open live stick, no hosts file installed.
                    keep the inspector panel in the browser open too. You may get quite a shock watching
                    the web activity. Pinging, telemetry and real time advertizing auctions become shockingly visible.

                    Get a bowl, you might need to vomit.

                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • You must be logged in to reply to this topic.