Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to resolve hostnames from /etc/hosts - like hosts files #1478

Closed
marcov opened this issue Mar 14, 2020 · 5 comments
Closed

Comments

@marcov
Copy link

marcov commented Mar 14, 2020

When using AGH on a home router, it would be really useful to resolve the hostnames of the devices in the LAN.

OpenWrt based routers automatically generate a hosts file in /tmp/hosts/hosts.auto /tmp/hosts/dhcp.cfg01411c, using both static hostname provided by the user, and hostname gathered with DHCP requests.
However a.t.m. hostnames in this file cannot be resolved by AGH, limiting users ability to interact with other devices in the network without using IP addresses.

Proposed Solution

Resolve hostname from a user-specified set of hosts files.

Alternatives Considered

Have a well-known set of hosts file paths hardcoded, or editable in the yaml config file.

@marcov marcov changed the title Add the ability to resolvehostnames from /etc/hosts Add the ability to resolve hostnames from /etc/hosts Mar 14, 2020
@ameshkov ameshkov added this to the v0.102 milestone Mar 16, 2020
@ameshkov
Copy link
Member

ameshkov commented Mar 16, 2020

@marcov so would you like us to do all three?

  1. /etc/hosts
  2. /tmp/hosts/hosts.auto
  3. DHCP (in the case if AdGuard's DHCP server is enabled)

@ameshkov
Copy link
Member

@szolin additionally to answering A/AAAA, we should also be able to handle PTR requests, check the relevant discussion here: #1458

@szolin
Copy link
Contributor

szolin commented Mar 16, 2020

There's no /tmp/hosts/hosts.auto on our openwrt device but /tmp/hosts/dhcp.cfg01411c instead.

@marcov
Copy link
Author

marcov commented Mar 16, 2020

@szolin, you are right, /tmp/hosts/dhcp.cfg01411c is the right path (/tmp/hosts/hosts.auto is a custom mod I did locally).

@ameshkov that would be awesome.
Even better if for 1. and 2. you could let the user specify an arbitrary list of paths.

@marcov marcov changed the title Add the ability to resolve hostnames from /etc/hosts Add the ability to resolve hostnames from /etc/hosts - like hosts files Mar 16, 2020
@ameshkov
Copy link
Member

@szolin it seems you forgot about handling PTR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants