jaerc
January 15, 2020, 8:11pm
1
Hi,
If I do a pihole -r and try to set 127.0.0.1#5353 in the dns section I get the answer this is an invalid DNS server address. It looks like #5353 ist not allowed I need for my unbound configuration.regarding the dns resolver.
So I'd like to open a feature request, that this setting can be made in pihole -r configuration.
Many thanks,
Chris
Might be the same underlying issue
opened 02:12PM - 05 Mar 19 UTC
closed 07:04PM - 23 Nov 20 UTC
triage: Issue
**In raising this issue, I confirm the following:** `{please fill the checkboxes… , e.g: [X]}`
- ✅ I have read and understood the [contributors guide](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md).
- ✅ The issue I am reporting can be *replicated*.
- ✅ The issue I am reporting isn't a duplicate (see [FAQs](https://github.com/pi-hole/pi-hole/wiki/FAQs), [closed issues](https://github.com/pi-hole/pi-hole/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), and [open issues](https://github.com/pi-hole/pi-hole/issues)).
**How familiar are you with the the source code relevant to this issue?:**
4
---
**Expected behaviour:**
When choosing a `Custom` DNS server, I want to be able to provide `127.0.0.1#54` (as I am already running an `unbound` instance on port 54, similar to the suggested setup at https://docs.pi-hole.net/guides/unbound/)
**Actual behaviour:**
Error message `One or both entered IP addresses were invalid.`
**Steps to reproduce:**
`./basic-install.sh`
When asked `Select Upstream DNS Provider. To use your own, select Custom.`, select `Custom`
At the next text field, enter `127.0.0.1#54`
**Troubleshooting undertaken, and/or other relevant information:**
`{Steps of what you have done to fix this}`
Removed check from the installer
Should be fixed/implemented by
pi-hole:development
← pi-hole:ip_validation
opened 08:38PM - 13 Jun 20 UTC
**By submitting this pull request, I confirm the following:**
- [x] I have r… ead and understood the [contributors guide](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md), as well as this entire template.
- [x] I have made only one major change in my proposed changes.
- [x] I have commented my proposed changes within the code.
- [x] I have tested my proposed changes, and have included unit tests where possible.
- [x] I am willing to help maintain this change if there are issues with it later.
- [x] I give this submission freely and claim no ownership.
- [x] It is compatible with the [EUPL 1.2 license](https://opensource.org/licenses/EUPL-1.1)
- [x] I have squashed any insignificant commits. ([`git rebase`](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
---
**What does this PR aim to accomplish?:**
This PR is two-fold:
My first aim was to fix a potential exploit reported by validating the IP used in `pihole -a setdns`. This is done by sourcing the install script in `webpage.sh` and using the `valid_ip()` function.
Secondly, a "whilst I'm in here" - I have expanded the valid_ip() function to accept custom IP addresses with a port number (i.e 1.1.1.1#5353)
Exemplary output from testing the function:
```
[adam@ADAM-PC ~]# ./valid_ip.sh
4.2.2.2 : good
a.b.c.d : bad
192.168.1.1 : good
0.0.0.0 : good
255.255.255.255 : good
255.255.255.256 : bad
192.168.0.1 : good
192.168.0 : bad
1234.123.123.123 : bad
192.168.0.119#5353 : good
1.1.1.1#65536 : good
1.1.1.1#65537 : bad
1.1.1.1#12345 : good
1.1.1.1#00000 : bad
1.1.1.1#0 : bad
1.1.1.1# : bad
```