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

Publish secondary DNS IP Address - dhcp-option=6 #1708

Closed
milothomas opened this issue May 20, 2020 · 18 comments
Closed

Publish secondary DNS IP Address - dhcp-option=6 #1708

milothomas opened this issue May 20, 2020 · 18 comments

Comments

@milothomas
Copy link

When using AdGuard as DHCP server, only the primary DNS server address is published. This causes some OnePlus devices to automatically use 8.8.8.8 as the secondary DNS server.

Can we have an option to publish the same IP address for both primary and secondary DNS server addresses?

@Sennevds
Copy link

Sennevds commented Jun 3, 2020

I have the same problem! No my dns rewrites don't work for my cellphone which is quiet annoying.

@temporallyaccount
Copy link

@ameshkov can you check this #1822 (comment)
above @milothomas said problem happen on other brands too so.

@dmshimself
Copy link

I'd definitely like to see this, plus being able to set the domain name

@ameshkov ameshkov modified the milestones: v0.107, v0.105 Nov 6, 2020
@ameshkov ameshkov modified the milestones: v0.105, v0.104 Nov 6, 2020
adguard pushed a commit that referenced this issue Nov 9, 2020
Merge in DNS/adguard-home from 1708-secondary-dns to master

Updates #1708.

Squashed commit of the following:

commit 4529452
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Nov 9 18:12:57 2020 +0300

    * dhcpd: send secondary dns as well
@ainar-g
Copy link
Contributor

ainar-g commented Nov 9, 2020

Hi! We've recently pushed a patch for this. Could you please update to the latest development snapshot and check if that fixes the 8.8.8.8 issue?

@Sennevds
Copy link

Sennevds commented Nov 9, 2020

I've just updated to the latest docker(edge) and the 8.8.8.8 address is gone!

@ameshkov
Copy link
Member

ameshkov commented Nov 9, 2020

Awesome, thanks for checking it!

@ainar-g
Copy link
Contributor

ainar-g commented Nov 11, 2020

We'll close this issue for now. @milothomas, please feel free to reopen with more details if the development version doesn't fix it for you.

@ainar-g ainar-g closed this as completed Nov 11, 2020
@loll31
Copy link

loll31 commented Dec 1, 2020

hey, i tried last docker images (latest and edge) for testing dhcp 6 option and behavior seems to be incorrect.
if option "- 6 ip addrip" is added, client received only 1 dns server IP and it's the one defined by option.
So i lost adguardhome dns if i used 'option 6'.
My goal is to manage 2 PIs providing adguardhome services at the same time. For surety, the two IP must be announced by DHCP services...

@ainar-g
Copy link
Contributor

ainar-g commented Dec 2, 2020

@loll31, hi and thank you for your message. There seems to be a misunderstanding or, perhaps, a documentation issue here. In this issue we fixed the logic of sending AdGuardHome's own IP addresses when users don't specify their own servers with option 6. Currently, options set by users silently override the ones set by AdGuardHome automatically, so if you set only one DNS server with option 6 then the DHCP clients will only receive the one address.

Maybe we need to print a warning, on the info level, when users' options override the automatic ones? Perhaps, another warning when the users only provide one DNS server address? Or just automatically double it? Or both? Or just document the whole thing in a separate wiki article?

@ameshkov, what do you think? I personally favour the wiki approach.

@ameshkov
Copy link
Member

ameshkov commented Dec 2, 2020

@ainar-g users can specify multiple DNS servers using option 6, right?

If so, we should just explain that in the Wiki that if this option is set, you'll need to specify AGH address explicitly.

@loll31
Copy link

loll31 commented Dec 2, 2020

@ainar-g , @ameshkov , thanks for the feedback. i tryed to set 2 IP via option ( - 6 ip ip1,ip2 or - 6 ip ip1 ip2 , w/ or w/o quotes, -6 text "ip1,ip2" or - 6 '''ip','ip'" ...) in vain.
For my comprehension, if option 6 is set, the AGH IP is not used as DNS and users could define 1 or 2 DNS (or more, i dont know if bootp/dhcp norm accepts it) . To resolve the problem OnePlus, maybe AGH should duplicate same IP if only one address is set in config file...

@ainar-g
Copy link
Contributor

ainar-g commented Dec 2, 2020

@ameshkov@loll31, it seems that AdGuardHome currently cannot parse two IPs there. Or rather, it can only do it if you use the hex form. So, there are at least two issues here:

  1. AdGuardHome cannot parse multiple IPs in DHCP options. This is now DHCP options with multiple IPs #2385.
  2. Our DHCP documentation is a bit lacking. This is now Wiki page about running AGH as a DHCP server #2386.

@loll31
Copy link

loll31 commented Dec 2, 2020

Do you have the syntax for hex form ?
ex: 192.168.1.1 and 192.168.1.2 two DNS servers should be (or a separator should be added ?)

  • 6 hex 0xC0A80101C0A80102

@ainar-g
Copy link
Contributor

ainar-g commented Dec 2, 2020

@loll31, try this:

6 hex c0a80101c0a80102

@loll31
Copy link

loll31 commented Dec 2, 2020

@ainar-g client sets both ip addresses ! +1
options:
- 6 hex c0a80101c0a80102

Nice !
It's working OOTB !

@loll31
Copy link

loll31 commented Dec 2, 2020

Maybe not the right place but i try to add option 252 for proxy information. I use
options:
- 252 text "http://192.168.1.1/wpad.dat"
But it seems that it's not sent to client...
Can you confirmed that this is managed by ADH dhcpd ?

@ainar-g
Copy link
Contributor

ainar-g commented Dec 2, 2020

@loll31, definitely not the right place to ask. Please write a new issue. We'll label it as a question and respond when we have the time.

@loll31
Copy link

loll31 commented Dec 2, 2020

ok. See you

adguard pushed a commit that referenced this issue Dec 10, 2020
Merge in DNS/adguard-home from 1708-secondary-dns to master

Updates #1708.

Squashed commit of the following:

commit 4529452
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Nov 9 18:12:57 2020 +0300

    * dhcpd: send secondary dns as well
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

7 participants