Comments (20)
Thanks for the request. Will get the environment variable added in the upcoming update.
from dnsserver.
How is your release schedule? I'd like to know when I should check back.
The next update is planned for upcoming weekend but it may get a bit delayed too. I will post here when its available so that you are notified.
from dnsserver.
Doing a code search for how this text field is handled...
Element ID: txtWebServiceLocalAddresses
That element gets sanitized for saving here:
DnsServer/DnsServerCore/www/js/main.js
Lines 1436 to 1442 in 05ec6a5
relevant HTTP request:
DnsServer/DnsServerCore/www/js/main.js
Lines 1733 to 1752 in 05ec6a5
and it is retrieved here:
DnsServer/DnsServerCore/www/js/main.js
Lines 958 to 962 in 05ec6a5
relevant HTTP request:
DnsServer/DnsServerCore/www/js/main.js
Lines 924 to 937 in 05ec6a5
from dnsserver.
Settings API source code:
https://github.com/TechnitiumSoftware/DnsServer/blob/master/DnsServerCore/WebServiceSettingsApi.cs
from dnsserver.
Relevant lines for setting the web addresss:
DnsServer/DnsServerCore/WebServiceSettingsApi.cs
Lines 703 to 730 in 05ec6a5
Note this line from the above blob:
The restart of the server (and the application of the new listening address), starts here:
from dnsserver.
It is appears that while running, the webserver uses _dnsWebService._webServiceLocalAddresses for storing the listening address
The class for this is defined here:
https://github.com/TechnitiumSoftware/DnsServer/blob/master/DnsServerCore/DnsWebService.cs
Here is the property:
DnsServer/DnsServerCore/DnsWebService.cs
Line 92 in 05ec6a5
from dnsserver.
This appears to be where the config is read from:
DnsServer/DnsServerCore/DnsWebService.cs
Line 1144 in 05ec6a5
DnsServer/DnsServerCore/DnsWebService.cs
Lines 1151 to 1166 in 05ec6a5
Which is wrapped by this method:
DnsServer/DnsServerCore/DnsWebService.cs
Lines 1108 to 1142 in 05ec6a5
Which is called by this method:
DnsServer/DnsServerCore/DnsWebService.cs
Line 858 in 05ec6a5
Which loads the config file with this snippet:
DnsServer/DnsServerCore/DnsWebService.cs
Lines 860 to 875 in 05ec6a5
from dnsserver.
Config file (for the DnsWebService class) appears to be defined here on Linux:
DnsServer/DnsServerApp/Program.cs
Line 54 in 05ec6a5
Which is pulled from the arguments passed to the executable:
DnsServer/DnsServerApp/Program.cs
Lines 32 to 33 in 05ec6a5
Which for docker, is defined in the service file:
from dnsserver.
Next thing I need to do is to determine if I can even interact with that binary file (dns.config). When I try to cat it on ubuntu, I got a bunch of garbage in the output, so it does not appear to be plain text
from dnsserver.
Looks like it should be easy to set it with the LoadConfigFile() method:
DnsServer/DnsServerCore/DnsWebService.cs
Lines 896 to 910 in 05ec6a5
You would just have to transpile the sanitization scripts and place them in the above blob
frontend:
DnsServer/DnsServerCore/www/js/main.js
Lines 1436 to 1442 in 05ec6a5
backend:
DnsServer/DnsServerCore/WebServiceSettingsApi.cs
Lines 703 to 730 in 05ec6a5
from dnsserver.
It looks like it might not even need to be that complicated, since cleanTextList just replaces newlines and removes additional commas
// Replace newlines with commas
string webServiceLocalAddresses = input.Replace("\n", ",")
// Replace duplicate commas with single commas
webServiceLocalAddresses = Regex.Replace(webServiceLocalAddresses, ",{2,}", ",");
// Trim the string of starting/trailing whitespace and commas
webServiceLocalAddresses = Regex.Replace(webServiceLocalAddresses, "(?:^[, ]+)|(?:[, ]+$)", ",");
// insert above snippet from DnsServerCore/WebServiceSettingsApi.cs (lines L703-L730)
// ...
I currently lack an environment to build and test on right now, but if someone thinks they can get a fork/PR spun up faster than me, please go for it. If not, I might have my lab back up and running by end of this week or next week.
from dnsserver.
How is your release schedule? I'd like to know when I should check back.
from dnsserver.
Technitium DNS Server v12.1 is now available that adds the environment variable. Do update and let me know your feedback.
from dnsserver.
Will do. Have inspections this weekend, so this will likely get implemented later this week
from dnsserver.
New environment variable (DNS_SERVER_WEB_SERVICE_LOCAL_ADDRESSES) will need to be added to the docker compose file.
Testing out the change now. Give me a bit
from dnsserver.
Works for singular listening address.
DNS_SERVER_WEB_SERVICE_LOCAL_ADDRESSES="172.18.0.1" # Single Docker bridge address
Rebuilding it for 2 addresses
DNS_SERVER_WEB_SERVICE_LOCAL_ADDRESSES="172.18.0.1, 172.17.0.1" # Multiple Docker bridge addresses, comma-delimited
I'm not entirely sure if the environment variables can handle line returns, but I don't see why anyone would use line returns over the comma-delimiter for this. So I won't test that.
from dnsserver.
It did not like the comma-delimited address
EDIT: also tried newlines with compose.yaml:
- DNS_SERVER_WEB_SERVICE_LOCAL_ADDRESSES=|
172.18.0.1
127.0.0.1 # also changed this just in case it didn't like the docker bridge adapter
Did not work, but newlines seem like a strange way to do this from yaml, so I would worry about the prior, but not the latter.
from dnsserver.
Here are the logs:
dns-dhcp-test | System.FormatException: An invalid IP address was specified.
dns-dhcp-test | ---> System.Net.Sockets.SocketException (22): Invalid argument
dns-dhcp-test | --- End of inner exception stack trace ---
dns-dhcp-test | at System.Net.IPAddressParser.Parse(ReadOnlySpan`1 ipSpan, Boolean tryParse)
dns-dhcp-test | at TechnitiumLibrary.StringExtensions.Split[T](String value, Func`2 parse, Char[] separator) in Z:\Technitium\Projects\TechnitiumLibrary\TechnitiumLibrary\StringExtensions.cs:line 34
dns-dhcp-test | at DnsServerCore.DnsWebService.LoadConfigFile() in Z:\Technitium\Projects\DnsServer\DnsServerCore\DnsWebService.cs:line 898
dns-dhcp-test | at DnsServerCore.DnsWebService.StartAsync() in Z:\Technitium\Projects\DnsServer\DnsServerCore\DnsWebService.cs:line 2540
dns-dhcp-test | at TechnitiumLibrary.TaskExtensions.Sync(Task task) in Z:\Technitium\Projects\TechnitiumLibrary\TechnitiumLibrary\TaskExtensions.cs:line 56
dns-dhcp-test | at DnsServerCore.DnsWebService.Start() in Z:\Technitium\Projects\DnsServer\DnsServerCore\DnsWebService.cs:line 2668
dns-dhcp-test | at DnsServerApp.Program.Main(String[] args) in Z:\Technitium\Projects\DnsServer\DnsServerApp\Program.cs:line 55
dns-dhcp-test |
dns-dhcp-test | Technitium DNS Server is stopping...
dns-dhcp-test | Technitium DNS Server was stopped successfully.
dns-dhcp-test exited with code 0
from dnsserver.
Got it. The compose file did not like the quotes, so in YAML you can use:
- DNS_SERVER_WEB_SERVICE_LOCAL_ADDRESSES=172.18.0.1,127.0.0.1
Will be submitting a PR for the docker compose file
from dnsserver.
Thanks for the feedback and for the PR. Had missed updating the docker compose file to add it.
from dnsserver.
Related Issues (20)
- Feature Request: Docker ENV Variable for Zone files HOT 1
- Cannot transfer root zone anymore HOT 8
- Install script missing default exception handler HOT 3
- Stopped working HOT 3
- Query Logs on Musl/Alpine not working HOT 4
- Dns Client Utility not Showing Response HOT 2
- Application runs as root on Linux HOT 3
- Feature Request Sort/Filter DHCP Reserved Leases HOT 1
- Random DNSSEC errors after 12.1 update HOT 12
- Add unit tests HOT 1
- allow to set HTTP PROXY for HTTP/S access while still using non-proxied DNS over UDP forwarders HOT 5
- Proplem With L2tp VPN Mikrotik HOT 3
- [ Feature Request ] ECS Based Client Configuration HOT 4
- [ Feature Request ] Have UI page state across refresh HOT 2
- I've already turned the intercept off. Why can I still intercept? HOT 19
- How does DnsServer ui counterproxy web pages HOT 5
- certain manual block entries not working HOT 2
- Query Logs Proplem HOT 5
- Why does Technitium DNS Server create and keep so many connections to public dns server? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dnsserver.