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

DHCP: automatic hostnames #1956

Closed
AlecRust opened this issue Jul 26, 2020 · 5 comments
Closed

DHCP: automatic hostnames #1956

AlecRust opened this issue Jul 26, 2020 · 5 comments

Comments

@AlecRust
Copy link

AlecRust commented Jul 26, 2020

Problem Description

I switched from Pi-hole to AGH recently. Everything was seamless apart from a surprising issue with hostnames. I previously relied on Pi-hole's automatic hostnames to avoid needing to set up static leases on the DHCP server.

For example with Pi-hole my iPhone named "Alec's iPhone" would automatically be available at alecs-iphone.lan without a static lease. The device would receive a new IP occasionally but always be available at alecs-iphone.lan.

To achieve this with AGH it seems I have to do two things for each device:

  1. Set up a DHCP static lease. This wasn't necessary on Pi-hole and in some ways defeats the purpose of what I'm trying to achieve. This AGH lease requires a "Hostname" which I originally thought I would be able to ping but it appears not. I'm not sure where this "Hostname" is actually used.

  2. Add a custom filtering rule like below. It appears this is where the hostname is actually defined, allowing me to ping alecs-iphone.lan. But it also means that any requests through this rule show as "blocked" in my stats.

    192.168.1.15 alecs-iphone.lan
    

The two required steps for each device and their drawbacks makes trying to achieve my goal not really worth it in AGH, since each device needs a static lease anyway so there's a fixed IP to use. And the impact to the stats make them basically useless (says over 50% of all queries were blocked etc.).

Proposed Solution

If AGH automatically created resolvable hostnames from the names of devices like Pi-hole that would allow me to remove my static leases and custom filtering rules.

If AGH gave some way to change these device names and the underlying hostname without setting a static lease for the device (similar to how you can name devices in your router) then it would be far better than Pi-hole, and afaik basically make static leases redundant if you only used the hostname to communicate with the device.

Alternatives Considered

The closest similar request I could find is #783, but not sure this is a duplicate of that.

Additional Information

I am running the AdGuard Home Home Assistant Community Add-on so don't have easy access to the filesystem to create a file for listing these. And the point of this issue is that a list in a hosts file that needs to be manually maintained shouldn't be necessary.

@AlecRust AlecRust changed the title Automatic hostnames [Feature Request] Automatic hostnames Jul 26, 2020
@Aikatsui
Copy link
Contributor

#1468

@ameshkov
Copy link
Member

ameshkov commented Jul 30, 2020

Quick question -- do you use AdGuard's DHCP server? I mean most likely you do, but you didn't state it anywhere.

@AlecRust
Copy link
Author

@ameshkov yes, I do.

@ameshkov
Copy link
Member

@szolin do you remember why we limited resolution to static leases only? It sounds perfectly okay to do this for dynamic leases as well.

@ameshkov ameshkov added this to the v0.104 milestone Jul 30, 2020
@szolin
Copy link
Contributor

szolin commented Jul 30, 2020

do you remember why we limited resolution to static leases only?

It's not implemented. We implemented support for PTR requests only - #1682

@ameshkov ameshkov changed the title [Feature Request] Automatic hostnames DHCP: automatic hostnames Jul 30, 2020
adguard pushed a commit that referenced this issue Aug 18, 2020
#1956

Squashed commit of the following:

commit efeacd9
Author: Simon Zolin <[email protected]>
Date:   Tue Aug 18 13:54:15 2020 +0300

    * DNS: resolve host names from DHCP: improve

    . Require a valid host name from DHCP lease
    . Use lower-case names
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