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

Make autohost TLDs configurable #2393

Closed
ainar-g opened this issue Dec 4, 2020 · 7 comments
Closed

Make autohost TLDs configurable #2393

ainar-g opened this issue Dec 4, 2020 · 7 comments

Comments

@ainar-g
Copy link
Contributor

ainar-g commented Dec 4, 2020

Context.

Currently, our autohost feature uses the .lan TLD, but there isn't really a consensus on what TLD is the best for such situations. So, we probably need to make it configurable.

@alexpovel
Copy link

alexpovel commented Jan 19, 2021

This would be a fantastic feature. Would like this a lot. Glad I found this issue.

As far as "no consensus" goes, I had read this thread. Now I'd like to go the home.mydomain.com (or similar) route. .lan works fine for now, but as mentioned in those threads, it's not safe until we have proper reserved TLDs for home/private/internal use (.lan is currently nothing official AFAIK: not a global TLD but also not explicitly reserved for internal use).

The cool thing about using a FQDN you own is that you can get certificates for private use, via Let's Encrypt's DNS challenge, for example using Caddy. This works without the requesting machine having to be publicly accessible. In theory, this would upgrade the home network quite a bit and stop browsers from throwing tantrums about untrusted local HTTPS, or unsecured HTTP sites.

Could this feature become a YAML config option? Would prefer that over a GUI approach.

Are these the relevant two lines with .lan?

if !strings.HasSuffix(host, ".lan.") {
return resultDone
}
host = strings.TrimSuffix(host, ".lan.")

If this were Python, I'd have a crack at it...

@ainar-g
Copy link
Contributor Author

ainar-g commented Jan 21, 2021

@alexpovel, yeah that's the piece. You could try, but be aware that PRs are unfortunately taking a lot of time to get reviewed right now, and the code is also a bit… macaroney with the configuration.

@Lenart12
Copy link

Lenart12 commented Feb 7, 2021

Changing dhcp option in the config files under dhcp->dhcpv4->options by setting - 15 hex 6c616e (setting dhcp domain name to lan) seems to make local rewrites like host1.lan work, however it would still be nice if we could change that via gui or in the configs to something other than lan.

@alexpovel
Copy link

@Lenart12 , .lan is the current, hard-coded default, so it should definitely work, see also this earlier comment. It also works without doing anything.

The interesting part would be if other values work, or what it says in

cat /var/lib/dhcp/dhclient.*leases

on one of your machines that received a DHCP lease with that - 15 hex 6c616e option set. In my network, it doesn't mention lan anywhere, because I haven't set that option - so all as expected. Does it show a value there for you? That would make things different.

adguard pushed a commit that referenced this issue Mar 25, 2021
Updates #2393.

Squashed commit of the following:

commit 8703413
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 15:48:46 2021 +0300

    dnsforward: fix

commit abf3a1c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 15:21:11 2021 +0300

    dnsforward: imp code, validation

commit fac389b
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 14:54:45 2021 +0300

    all: add validation, imp docs, tests

commit 21b4532
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 24 19:09:43 2021 +0300

    all: custom autohost tlds
adguard pushed a commit that referenced this issue Mar 25, 2021
Updates #2393.

Squashed commit of the following:

commit 5ea4d3c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 17:01:08 2021 +0300

    dnsforward: fix nxdomain for internal aaaa reqs
@ainar-g
Copy link
Contributor Author

ainar-g commented Mar 25, 2021

This is implemented as of snapshot 3764c1d. The Wiki is also updated. Please feel free to file new issues if you have any problems!

@ainar-g ainar-g closed this as completed Mar 25, 2021
@alexpovel
Copy link

Where in the wiki? I was only able to find this entry which references back this issue as a WIP.

@ainar-g
Copy link
Contributor Author

ainar-g commented Mar 26, 2021

@alexpovel, it's on the “Configuration” page, in dns→Other setings→autohost_tld. (The page really needs a proper refactoring, to be honest.) But you are correct, the DHCP page needs to be updated as well. We're going to update it soon™.

heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Updates AdguardTeam#2393.

Squashed commit of the following:

commit 8703413
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 15:48:46 2021 +0300

    dnsforward: fix

commit abf3a1c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 15:21:11 2021 +0300

    dnsforward: imp code, validation

commit fac389b
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 14:54:45 2021 +0300

    all: add validation, imp docs, tests

commit 21b4532
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 24 19:09:43 2021 +0300

    all: custom autohost tlds
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Updates AdguardTeam#2393.

Squashed commit of the following:

commit 5ea4d3c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 17:01:08 2021 +0300

    dnsforward: fix nxdomain for internal aaaa reqs
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

3 participants