Adguardhome: Add an option to ignore local hosts file

Created on 26 Jul 2020  路  7Comments  路  Source: AdguardTeam/AdGuardHome

Hello,

using latest 0.103.2 I found that it parse local /etc/hosts file and return addresses from it and return to clients wrong IP.
e.g., hosts have record
127.0.0.1 domain.name
and when client request domain.name agh return 127.0.0.1 instead of forwarding query to upstream...
I need to disable reading local hosts file

Medium enhancement

Most helpful comment

I'd prefer to have possibility disable reading local hosts file

hosts have higher priority of dns for local host and I can override some hosts for some purposes. plus I prefer local host domain name point to 127.0.0.1 instead of static or dynamic ip.
and what you've done? - you translate local host setting to all agh clients...
this is not acceptable!

All 7 comments

This is the intended behavior. Please explain why do you want to change it and why can't you edit the hosts file instead?

I'd prefer to have possibility disable reading local hosts file

hosts have higher priority of dns for local host and I can override some hosts for some purposes. plus I prefer local host domain name point to 127.0.0.1 instead of static or dynamic ip.
and what you've done? - you translate local host setting to all agh clients...
this is not acceptable!

in addition you broke another thing:
for example, there is domain example.com
it has A and MX records
if call host example.com
result will contain both A and MX records
if add example.com to /etc/hosts and ask host example.com
in this case only A record is returned and no MX

I'd prefer to have possibility disable reading local hosts file

I want to have a function like this too

@ameshkov, yes, it must be definitely optional. I use four IP addresses (two ipv4 and two ipv6), but because of the hosts file, essentially only one ipv4 address works when I access the domain馃槖

Temporary solution - use AGH docker image

Temporary solution - use AGH docker image

I also interest for this topic. "Add an option to ignore local hosts file"
Docker instance too apply it's etc/hosts https://github.com/AdguardTeam/AdGuardHome/issues/2085

Was this page helpful?
0 / 5 - 0 ratings