Once you edit the hosts file with your overrides you may need to flush the local DNS on linux.

On Linux Mint / Debian you can use the following to see the DNS stats

sudo systemd-resolve --statistics

you will see the following

DNSSEC supported by current servers: no

Transactions
Current Transactions: 0
  Total Transactions: 8133

Cache
  Current Cache Size: 20
          Cache Hits: 2381
        Cache Misses: 2909

DNSSEC Verdicts
              Secure: 0
            Insecure: 0
               Bogus: 0
       Indeterminate: 0

You can then use the following to flush the cache

sudo systemd-resolve --flush-caches

Performing a sudo systemd-resolve –statistics again will show the Current Cache Size as zero to confirm it is clear.