Add DNS server setting [90%]

Use this forum if you want to suggest a new feature to hMailServer. Before posting, please search the forum to confirm that it has not already been suggested.
Post Reply

Need DNS Setting

yes
12
55%
no.
10
45%
 
Total votes: 22

User avatar
yon
Normal user
Normal user
Posts: 129
Joined: 2009-11-06 10:44

Add DNS server setting [90%]

Post by yon » 2012-03-22 18:33

I need add dns setting for hmail server. I can't use local dns .
IPv6 Email Public Service www.ipv6china.com World's first

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting

Post by Bill48105 » 2012-03-22 19:13

Been awhile since I looked at the code but I *think* it shouldn't be too bad to add but odds are I'd do INI's at 1st like I've done with other settings. I imagine 99.99% of the time people can just use their Windows DNS servers but suspect there could be times where it'd be handy to be able to over-ride & set different ones so worth looking into.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
yon
Normal user
Normal user
Posts: 129
Joined: 2009-11-06 10:44

Re: Add DNS server setting

Post by yon » 2012-03-22 19:26

Bill48105 wrote:Been awhile since I looked at the code but I *think* it shouldn't be too bad to add but odds are I'd do INI's at 1st like I've done with other settings. I imagine 99.99% of the time people can just use their Windows DNS servers but suspect there could be times where it'd be handy to be able to over-ride & set different ones so worth looking into.
Bill
because our Country ISP block some DNS and a lot of site ip, So my build local dns server only for over block firewall. So I have to config dns setting in hmail server user other normal dns server for mx records so on.
IPv6 Email Public Service www.ipv6china.com World's first

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting

Post by Bill48105 » 2012-03-22 19:28

yon wrote:because our Country ISP block some DNS and a lot of site ip, So my build local dns server only for over block firewall. So I have to config dns setting in hmail server user other normal dns server for mx records so on.
That makes sense but what I'm missing though is why that special local dns server can't be set in Windows too.. Can't you just set your Windows DNS to 127.0.0.1 or LAN IP of computer running DNS locally?
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
yon
Normal user
Normal user
Posts: 129
Joined: 2009-11-06 10:44

Re: Add DNS server setting

Post by yon » 2012-03-23 14:15

Bill48105 wrote:
yon wrote:because our Country ISP block some DNS and a lot of site ip, So my build local dns server only for over block firewall. So I have to config dns setting in hmail server user other normal dns server for mx records so on.
That makes sense but what I'm missing though is why that special local dns server can't be set in Windows too.. Can't you just set your Windows DNS to 127.0.0.1 or LAN IP of computer running DNS locally?
So my dns sevrer using IPv6 NAT DNS. all domain ipv4 address will change to ipv6 address. IP over DNS. :wink:
IPv6 Email Public Service www.ipv6china.com World's first

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting

Post by Bill48105 » 2012-03-23 14:31

yon wrote:So my dns sevrer using IPv6 NAT DNS. all domain ipv4 address will change to ipv6 address. IP over DNS. :wink:
So you can't just setup your own dns server & point your windows to it causing hmail to use it?
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
yon
Normal user
Normal user
Posts: 129
Joined: 2009-11-06 10:44

Re: Add DNS server setting

Post by yon » 2012-03-29 04:02

Bill48105 wrote:
yon wrote:So my dns sevrer using IPv6 NAT DNS. all domain ipv4 address will change to ipv6 address. IP over DNS. :wink:
So you can't just setup your own dns server & point your windows to it causing hmail to use it?
yes. my dns server will mx ipv4 address auto change to ipv6 address.
IPv6 Email Public Service www.ipv6china.com World's first

ObiWan
Senior user
Senior user
Posts: 281
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Add DNS server setting

Post by ObiWan » 2012-04-02 09:46

yon wrote:I need add dns setting for hmail server. I can't use local dns .
Install a DNS on the hMS box, either the regular windows DNS or the unbound one, configure the DNS to forward queries to whatever other external or local DNS servers you want and point the IP settings of the local machine to the local DNS (be it 127.0.0.1 or the local IP); no need to change hMS for such a task and sincerely, IPv6 or not, I see NO problem at all in doing the above

User avatar
yon
Normal user
Normal user
Posts: 129
Joined: 2009-11-06 10:44

Re: Add DNS server setting

Post by yon » 2012-04-02 15:16

my local DNS can't work for hmail server. it is for other service.

just like altn mdameon can setup dns.

Each network environment has different needs.

our country ISP blocked a lot of DNS server , ip address and domains. So we have to find other ways for it.
IPv6 Email Public Service www.ipv6china.com World's first

ObiWan
Senior user
Senior user
Posts: 281
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Add DNS server setting

Post by ObiWan » 2012-04-02 15:40

yon wrote:my local DNS can't work for hmail server. it is for other service.

just like altn mdameon can setup dns.

Each network environment has different needs.

our country ISP blocked a lot of DNS server , ip address and domains. So we have to find other ways for it.
Sorry but I'm not following you; probably it's due to the fact that I'm not a native english speaker, but sincerely, what you wrote, from a "tech" standpoint doesn't make sense at all. See, having a local DNS resolver means that you will then be able to setup conditional forwarding for whatever domain and to handle all your DNS resolution by yourself either by using recursion or by leveraging whatever external resolver as a forwarder. So, there's no "different needs" just an "explain with full details what you need and I/we may be able to help you"; there's no other way to address issues and in any case I don't think that the solution is changing the hMS code; there are a NUMBER (not kidding) other ways to achieve the same result w/o touching the code and, in general, a mailserver is just a piece of code running on a given host, and it obeys the host settings when it comes to network stuff (IP address, DNS ... and so on)

Bottom line, try getting a grip on what was already suggested since I *do* believe that your solution sits in there

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: Add DNS server setting

Post by dzekas » 2012-04-02 18:03

I think forum already has other feature request for it. It has long discussion and response from martin.

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting

Post by Bill48105 » 2012-04-02 23:58

After looking at code this shouldn't be too hard to add but not sure how useful to how many people it will be if done. Maybe I'll look into it further when I get time but it'd be nice to hear from more than 1 person that this would be useful. :D
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

ObiWan
Senior user
Senior user
Posts: 281
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Add DNS server setting

Post by ObiWan » 2012-04-03 08:36

Bill48105 wrote:After looking at code this shouldn't be too hard to add but not sure how useful to how many people it will be if done. Maybe I'll look into it further when I get time but it'd be nice to hear from more than 1 person that this would be useful. :D
Bill
Well, adding it won't be so difficult, just a matter of using a given array of DNS servers IPs when initializing the DNS resolver APIs; basically you'll need something like (code coming from some stuff I wrote time ago, just pasted some snippets)

Code: Select all


    PIP4_ARRAY pSrvList = NULL;

    fOptions = DNS_QUERY_STANDARD;
    if (NULL != lpstrServer) {
      // we got a server name or IP, use it for the query
      pSrvList = (PIP4_ARRAY)LocalAlloc(LPTR,sizeof(IP4_ARRAY));
      if (!pSrvList) {
        // bomb with error since we need this list
        printerror("pSrvList", GetLastError());
        return(-1);
      }
      // retrieve the IP (in binary format)
      ulDNS = GetDNSaddr(lpstrServer);
      if (INADDR_NONE == ulDNS) {
        // not a valid IP (or unresolvable host name)
        return(-2);
      }
      pSrvList->AddrCount = 1;
      pSrvList->AddrArray[0] = ulDNS;
      fOptions = DNS_QUERY_BYPASS_CACHE;
    }

    // run the query
    nStatus = DnsQuery(lpstrQuery, wType, fOptions, pSrvList, &pDnsRecords, NULL);

notice that the above only uses ONE DNS, by the way the code may be easily adapted to deal with multiple DNS servers (just a matter or allocating a proper size array and setting the count), also notice that whenever specifying DNS server(s) you'll need to add the "bytpass cache" flag or the query will fail; this has also a side effect, that is, the local DNS resolver cache (the windows DNS client/cache service) won't be populated with the results from the query and this, in turn, will slow things down a bit

That said, and given that as you wrote the change won't require too much effort, I think that adding an optional entry to the "ini" file allowing to specify the DNS server(s) to use may be the most straightforward way to implement such a feature; in this case the "ini" may contain something like (e.g.)

DNSresolvers=11.22.33.44,55.66.77.88,99.0.1.2

that is a comma separated list of IP addresses pointing to the DNS servers you want hMS to use; by the way, if the entry is blank or missing, hMS will just use the default resolver(s) as it does now

HTH

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting

Post by Bill48105 » 2012-04-03 18:14

ObiWan: Thx yeah that essentially the plan if we moved forward with this. Again I was waiting to see if more people would find this helpful. Obviously there are tons of things people are wanting, and most before this too. When I work on stuff I weigh it on my time available, how useful it'll be, how much time it'll take & how likely it will break something. This one seems like it'll take little time & likely won't break anything (at least could be tested easily) but I'm quite busy with life ATM & so far not looking like this will be super useful to people.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

ObiWan
Senior user
Senior user
Posts: 281
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Add DNS server setting

Post by ObiWan » 2012-04-03 18:19

Bill48105 wrote:ObiWan: Thx yeah that essentially the plan if we moved forward with this. Again I was waiting to see if more people would find this helpful. Obviously there are tons of things people are wanting, and most before this too. When I work on stuff I weigh it on my time available, how useful it'll be, how much time it'll take & how likely it will break something. This one seems like it'll take little time & likely won't break anything (at least could be tested easily) but I'm quite busy with life ATM & so far not looking like this will be super useful to people.
Bill
No problem, Bill and sincerely I don't see the need for such a feature so ... well, if you'll find time, add it, otherwise keep it in the backburner and give precedence to other stuff (and RL comes first btw :D); as a note - not willing to hijack the thread - I think that implementing SRS would be more important that such DNS stuff altough... ok, it would take much more time/effort, I know

Oh well, I'll stop here :)

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting

Post by Bill48105 » 2012-04-03 18:26

ObiWan wrote:
Bill48105 wrote:ObiWan: Thx yeah that essentially the plan if we moved forward with this. Again I was waiting to see if more people would find this helpful. Obviously there are tons of things people are wanting, and most before this too. When I work on stuff I weigh it on my time available, how useful it'll be, how much time it'll take & how likely it will break something. This one seems like it'll take little time & likely won't break anything (at least could be tested easily) but I'm quite busy with life ATM & so far not looking like this will be super useful to people.
Bill
No problem, Bill and sincerely I don't see the need for such a feature so ... well, if you'll find time, add it, otherwise keep it in the backburner and give precedence to other stuff (and RL comes first btw :D); as a note - not willing to hijack the thread - I think that implementing SRS would be more important that such DNS stuff altough... ok, it would take much more time/effort, I know

Oh well, I'll stop here :)
Yes you did hijack it & go off topic even after you said weren't going to. :P

Regarding your priorities, take SRS for example. In terms of my above criteria for when I work on stuff consider yes SRS would be very helpful to many people (although one could argue we all survive without it & it can be done in scripting), it would take a lot of time, is very likely to break something, I still have very little free time ATM. So 1 yay, 3 nays on SRS. ;)

Anyway yeah please don't trash up yon's thread more with further off-topic stuff. Feel free to create a new one if you want to discuss further. :)
Thx
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: Add DNS server setting

Post by dzekas » 2012-04-03 18:42


Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting

Post by Bill48105 » 2012-04-03 18:51

Thx for the link dzekas. That is from 2009, that is ancient history! lol
I see martin had no interest in hmail having option to define DNS servers..

dzekas: I see from your other replies you didn't see a need either.. Do you still feel that way or do you think yon's situation shows a need? Or is there a work-around?
Thx
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: Add DNS server setting

Post by dzekas » 2012-04-03 21:57

Bill48105 wrote:Do you still feel that way or do you think yon's situation shows a need? Or is there a work-around?
local dns service can forward requests to ISPs dns. For ISP there is no difference between workstation and other service which forwards unknown zone lookups to it. I can find other similar topic on this forum, where I asked user to setup local dns properly instead of asking for alternative dns settings.

hMailServer is an application. Alternative dns only makes it more complex. You can't test how it works, if your local telnet app uses one dns and smtp server uses something different. DNS settings must be shared between all applications for lookup consistency and management.

ObiWan
Senior user
Senior user
Posts: 281
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Add DNS server setting

Post by ObiWan » 2012-04-04 08:48

dzekas wrote:
Bill48105 wrote:Do you still feel that way or do you think yon's situation shows a need? Or is there a work-around?
local dns service can forward requests to ISPs dns. For ISP there is no difference between workstation and other service which forwards unknown zone lookups to it. I can find other similar topic on this forum, where I asked user to setup local dns properly instead of asking for alternative dns settings.

hMailServer is an application. Alternative dns only makes it more complex. You can't test how it works, if your local telnet app uses one dns and smtp server uses something different. DNS settings must be shared between all applications for lookup consistency and management.
Agreed; the only real need for different DNS settings may be for the cases when you have control on the mailserver (hMailServer) but not over the system (so can't change the DNS settings or the like); in such a case, being able to point the mailserver to a different DNS may be somewhat useful - but in general, as I wrote, I don't see a need for such a feature

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting

Post by Bill48105 » 2012-04-05 20:32

yon,
Seems when specifying dns servers for the query you lose out on resolver caching because it requires the DNS_QUERY_BYPASS_CACHE flag. Not sure how that'll affect performance vs using system dns but something to consider or look into.

Also, I'm not sure on using ipv6 dns servers with DnsQuery.. Would using an ipv4 IP suffice or do you need ipv6 for the server for your needs? Have a feeling there are a ton of changes needed for ipv6 still.. Since i don't use ipv6 or have any need for it I can't say for sure.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
yon
Normal user
Normal user
Posts: 129
Joined: 2009-11-06 10:44

Re: Add DNS server setting

Post by yon » 2012-04-06 08:26

DNS forward can't normal in our country. I have said, Country ISP Block all other country DNS servser,even IANA's DNS server.

Because the country ISP blocked all ipv4 network, so I using ipv6 dns and ipv6 adress point to ipv4 address.

but mail server need mormal others dns server.

About dns forwarding
http://forums.jhsoft.com/default.aspx?g=posts&t=429
IPv6 Email Public Service www.ipv6china.com World's first

User avatar
yon
Normal user
Normal user
Posts: 129
Joined: 2009-11-06 10:44

Re: Add DNS server setting

Post by yon » 2012-04-06 08:31

well.., from 2009?

Requests for additional functionality is very difficult. :(
IPv6 Email Public Service www.ipv6china.com World's first

User avatar
yon
Normal user
Normal user
Posts: 129
Joined: 2009-11-06 10:44

Re: Add DNS server setting

Post by yon » 2012-04-06 08:40

How I visit blocked ipv4 address? I am using ipv6 address forwarding to ipv4 address.

and dns forward must use TCP.

Because Government will Tampering with dns data when use udp for dns forward.
IPv6 Email Public Service www.ipv6china.com World's first

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: Add DNS server setting

Post by dzekas » 2012-04-06 16:44

yon wrote:DNS forward can't normal in our country.
DNS forwarding is one of your dns server configuration options. It has nothing to do with your country. If you ask for alternative DNS option, you do have access to unfiltered DNS. Use that unfiltered DNS as your primary DNS service on your email server.

If this option is implemented in hMailServer, will you go to Microsoft, Mozilla, OpenOffice and others asking for same thing in every program they produce?

ObiWan
Senior user
Senior user
Posts: 281
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Add DNS server setting

Post by ObiWan » 2012-04-07 15:35

dzekas wrote:
yon wrote:DNS forward can't normal in our country.
DNS forwarding is one of your dns server configuration options. It has nothing to do with your country. If you ask for alternative DNS option, you do have access to unfiltered DNS. Use that unfiltered DNS as your primary DNS service on your email server.

If this option is implemented in hMailServer, will you go to Microsoft, Mozilla, OpenOffice and others asking for same thing in every program they produce?
or either, just use a 6to4 tunnel so that you'll have a public IPv6 and will be able to also "talk" v6 to external hosts and perform v6 resolution (given that the DNS you use is able to deal with IPv6); that way all the traffic, be it v4 or v6 will be tunnelled over v6 but will be still able to reach both v4 or v6 hosts; again I think the whole point is totally UNRELATED to hMailServer and has to be dealt otherwise; as an example, try looking at this, the doc may help you understanding how to setup IPv6 on your box(es) and deciding which approach you want to use (ensure to read through parts 1...3)

ObiWan
Senior user
Senior user
Posts: 281
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Add DNS server setting

Post by ObiWan » 2012-04-07 16:00

Bill48105 wrote:yon,
Seems when specifying dns servers for the query you lose out on resolver caching because it requires the DNS_QUERY_BYPASS_CACHE flag. Not sure how that'll affect performance vs using system dns but something to consider or look into.

Also, I'm not sure on using ipv6 dns servers with DnsQuery.. Would using an ipv4 IP suffice or do you need ipv6 for the server for your needs? Have a feeling there are a ton of changes needed for ipv6 still.. Since i don't use ipv6 or have any need for it I can't say for sure.
Bill
Bill, as I wrote in another reply, I think that all this isn't a thing for hMailServer; what he needs is just to setup a 6to4 tunnel with whatever broker (e.g. Sixx or whatever) and then run his system over Ipv6, but this is NOT an issue with hMS, just a matter of correctly configuring the host system(s) :)

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting

Post by Bill48105 » 2012-04-07 18:42

It's easy to discount what other people need when you're not the one in their shoes. ;) Like I said before, it'd be great to find a working solution & preferably not 1/2-ass hacks. In terms of comparing hmail to other programs so it shouldn't have DNS option, to me that is bull. An email server is not 'Word' or just any other program so it could have special needs in certain circumstances. And it's always nice to have options available when the need arises. I don't understand why yon says he needs it but no doubt he believes it or he wouldn't be asking. But even though I don't understand his need I'm not writing off the possibility of adding dns to hmail either. Hopefully someone can come with something for him & not just bashing the idea or his situation.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

ObiWan
Senior user
Senior user
Posts: 281
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Add DNS server setting

Post by ObiWan » 2012-04-08 17:50

Bill48105 wrote:It's easy to discount what other people need when you're not the one in their shoes. ;) Like I said before, it'd be great to find a working solution & preferably not 1/2-ass hacks. In terms of comparing hmail to other programs so it shouldn't have DNS option, to me that is bull. An email server is not 'Word' or just any other program so it could have special needs in certain circumstances. And it's always nice to have options available when the need arises. I don't understand why yon says he needs it but no doubt he believes it or he wouldn't be asking. But even though I don't understand his need I'm not writing off the possibility of adding dns to hmail either. Hopefully someone can come with something for him & not just bashing the idea or his situation.
Bill
I understand your point, Bill, but let me say that hMailServer (if I'm not wrong) is a mail server and, trying to let it be everything to everyone isn't imHo a good idea since it may then end being nothing to nobody :) - that said, the DNS settings are relatively easy to implement, so, if you think they're worth, go for them; but sincerely, I do believe that a better solution for the issue would be installing an IPv6 tunnel s/w on the box so letting whatever app running on it transparently talking v6; that won't need any change to the s/w and will (most probably) allow to achieve the desired result.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Add DNS server setting

Post by ^DooM^ » 2012-04-08 20:12

I agree with Bill on this one. I believe hMail should have the ability to set it's own DNS servers. It should only be available via INI setting though and not added to the ini by default. This would leave hMail as is but for only those that really have no other choice but to change them. I had a hosting provider that has all their windows servers using something similar to opendns except it was serving up affiliate links for his own company which is not very good for a mailserver as has been discussed previously. I could not install a local DNS server as the provider would not allow it so I eventually moved to a different provider. Having the ability to change the DNS servers there would have been a huge help in that regard.

I vote to add the ability to hMail under the conditions I stated above :)
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
yon
Normal user
Normal user
Posts: 129
Joined: 2009-11-06 10:44

Re: Add DNS server setting

Post by yon » 2012-04-17 04:36

I think it is an very simply Function, I don't know why your can't understand it.

the altn's mdaemon mail server support this function.

http://www.altn.com/Support/KnowledgeBa ... =KBA-01280
Attachments
20120417103553.jpg
IPv6 Email Public Service www.ipv6china.com World's first

ObiWan
Senior user
Senior user
Posts: 281
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Add DNS server setting

Post by ObiWan » 2012-04-17 10:22

yon wrote:I think it is an very simply Function, I don't know why your can't understand it.
I don't think it's a matter of understanding it; on the opposite, I believe we understood what you're asking, it's just that, aside from the exceptions discussed in this thread, such a feature doesn't seem to be all that useful; but then, given that it should be relatively easy to implement (using an "ini" entry)... why not :) - as for the Alt-N mDaemon, that dialog made me laugh; see, asking for the hosts file path just means that whoever designed it didn't understand how the file fits inside the resolution process; there's NO need imHo to specify the path of the hosts file since it will be automatically accessed by the resolver - at any rate, and again, it's up to the devs; if they think they may just slip in such a change w/o wasting too much time then... be it

User avatar
yon
Normal user
Normal user
Posts: 129
Joined: 2009-11-06 10:44

Re: Add DNS server setting

Post by yon » 2012-04-18 21:59

I not need edit hosts file. just altn mdaemon has hosts edit gui,only for user easy use it. so some user not so know how network manager.

One more consideration is the user's use of the environment.
As much as possible to make the product easier to use. Perhaps this is a design idea. like This is why the windows system does not disappear, easy to use. :wink:
IPv6 Email Public Service www.ipv6china.com World's first

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: Add DNS server setting

Post by dzekas » 2012-04-18 22:18

yon wrote:This is why the windows system does not disappear, easy to use. :wink:
try switching language in windows and then find out how language is changed in other systems. count interpreters and shells available in windows and in other oses.

User avatar
yon
Normal user
Normal user
Posts: 129
Joined: 2009-11-06 10:44

Re: Add DNS server setting

Post by yon » 2012-06-15 17:17

my default dns server transfer and change ipv4 to ipv6.
Attachments
20120615231557.jpg
IPv6 Email Public Service www.ipv6china.com World's first

echoDreamz
New user
New user
Posts: 22
Joined: 2010-12-02 20:25

Re: Add DNS server setting

Post by echoDreamz » 2013-06-25 20:51

I am adding my vote for this.

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting

Post by Bill48105 » 2014-02-08 08:07

2014-02-08 5.4-B2014020801
* IMPORTANT: This build has a LOT of extra debug logging by default. Disable using [Settings]LogLevel=7 or lower
* Added ability to set custom DNS servers in INI DnsServers=192.168.1.33
* Only 1 DNS server for now! IPv6 compatibility UNKNOWN

http://www.hmailserver.com/forum/viewto ... 10&t=21420
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

ObiWan
Senior user
Senior user
Posts: 281
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Add DNS server setting

Post by ObiWan » 2014-03-03 09:51

Bill48105 wrote:yon,
Seems when specifying dns servers for the query you lose out on resolver caching because it requires the DNS_QUERY_BYPASS_CACHE flag. Not sure how that'll affect performance vs using system dns but something to consider or look into.
As a note, had a look at the DNS resolver source code found here (I think that's the latest version) and it sounds like it isn't using that flag the "DNS_QUERY_BYPASS_CACHE" option is commented out; I think you should add a check like (warning: air code)

Code: Select all

 DWORD fOptions;
 fOptions = DNS_QUERY_STANDARD;
 if (blnUseExternalDNS) 
 {
   // bypass cache if using external resolvers
   fOptions |= DNS_QUERY_BYPASS_CACHE;
 }
otherwise, queries using external resolvers would fail.

As for the cache, while it's true that using that flag will have the effect of NOT populating the local dns resolver cache, on the other hand, it won't have any effect on the external DNS resolver cache, so the resolver will still populate its cache (but the local DNS client won't) so it shouldn't possibly be a big issue

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting [90%]

Post by Bill48105 » 2014-03-04 07:31

Thx ObiWan but you're quoting me from something almost 2 years ago when this was being discussed.. If you look I added option for setting dns servers but have yet to have a single person try it & provide feedback so no idea if it even works beyond my brief testing.

As far as how it was done I simply used windows built-in dns resolver and yes bypass cache option is set just as MS says to. but it's only set IF dns servers are set in the ini otherwise windows default dns servers are used & bypass cache is not changed so it should be enabled.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

ObiWan
Senior user
Senior user
Posts: 281
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Add DNS server setting [90%]

Post by ObiWan » 2014-03-04 15:42

Bill48105 wrote:Thx ObiWan but you're quoting me from something almost 2 years ago when this was being discussed.. If you look I added option for setting dns servers but have yet to have a single person try it & provide feedback so no idea if it even works beyond my brief testing.

As far as how it was done I simply used windows built-in dns resolver and yes bypass cache option is set just as MS says to. but it's only set IF dns servers are set in the ini otherwise windows default dns servers are used & bypass cache is not changed so it should be enabled.
Bill
Mumble... so you're sayin' that the code found here

http://hmailserver.com:60951/svn/hms/tr ... solver.cpp

is outdated ?? If so... where do I find the latest code :) ?

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Add DNS server setting [90%]

Post by Bill48105 » 2014-03-04 20:08

ObiWan wrote:
Bill48105 wrote:Thx ObiWan but you're quoting me from something almost 2 years ago when this was being discussed.. If you look I added option for setting dns servers but have yet to have a single person try it & provide feedback so no idea if it even works beyond my brief testing.

As far as how it was done I simply used windows built-in dns resolver and yes bypass cache option is set just as MS says to. but it's only set IF dns servers are set in the ini otherwise windows default dns servers are used & bypass cache is not changed so it should be enabled.
Bill
Mumble... so you're sayin' that the code found here

http://hmailserver.com:60951/svn/hms/tr ... solver.cpp

is outdated ?? If so... where do I find the latest code :) ?
source changes have not been posted yet just pre-compiled experimental build for people to try & report back
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Add DNS server setting [90%]

Post by RvdH » 2021-06-25 13:22

Trying to implement this, as it would be cool to change this without having to change my network adapter settings
bill's solution works partially, eg: it works with a single DNS server IP4 address only (see: https://github.com/Bill48105/hmailserve ... solver.cpp)

Although using a single IP4 address works for me (127.0.0.1 = My Local Bind9 caching /forwarding server) maybe it would be best to add the abilities to define multiple IP4 DNS Server addresses (for the sake of completeness, variarity in setups) but i have some trouble finding c++ examples that could separate a comma delimited string in to a array


I already have made a (working) test inspired on bill's code using a fixed DNS server (127.0.0.1), changed a few bits and pieces (5.7.x)

Code: Select all

      if (IniFileSettings::Instance()->GetUseLocalDNSServer())
      {
         pSrvList = (PIP4_ARRAY)malloc(sizeof(IP4_ARRAY));
         if (!pSrvList) {

            String sMessage;
            sMessage.Format(_T("Unable to allocate memory for DNS server list. Query: %s, Type: %d."), query, resourceType);
            ErrorManager::Instance()->ReportError(ErrorManager::Low, 4401, "DNSResolver::_Resolve", sMessage);

            return false;
         }

         pSrvList->AddrCount = 1;
         pSrvList->AddrArray[0] = inet_addr("127.0.0.1"); //Local DNS server IP address
      }
Before i going any further with this, Does it make much sense to have hmailserver use different DNS servers as the normal systems default?
Or would a INI setting UseLocalDNSServer=1 for most circumstances satisfy the most common needs? (to use a local caching /forwarding server to do DNS lookups)
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Add DNS server setting [90%]

Post by SorenR » 2021-06-25 16:08

RvdH wrote:
2021-06-25 13:22
Trying to implement this, as it would be cool to change this without having to change my network adapter settings
bill's solution works partially, eg: it works with a single DNS server IP4 address only (see: https://github.com/Bill48105/hmailserve ... solver.cpp)

Although using a single IP4 address works for me (127.0.0.1 = My Local Bind9 caching /forwarding server) maybe it would be best to add the abilities to define multiple IP4 DNS Server addresses (for the sake of completeness, variarity in setups) but i have some trouble finding c++ examples that could separate a comma delimited string in to a array


I already have made a (working) test inspired on bill's code using a fixed DNS server (127.0.0.1), changed a few bits and pieces (5.7.x)

Code: Select all

      if (IniFileSettings::Instance()->GetUseLocalDNSServer())
      {
         pSrvList = (PIP4_ARRAY)malloc(sizeof(IP4_ARRAY));
         if (!pSrvList) {

            String sMessage;
            sMessage.Format(_T("Unable to allocate memory for DNS server list. Query: %s, Type: %d."), query, resourceType);
            ErrorManager::Instance()->ReportError(ErrorManager::Low, 4401, "DNSResolver::_Resolve", sMessage);

            return false;
         }

         pSrvList->AddrCount = 1;
         pSrvList->AddrArray[0] = inet_addr("127.0.0.1"); //Local DNS server IP address
      }
Before i going any further with this, Does it make much sense to have hmailserver use different DNS servers as the normal systems default?
Or would a INI setting UseLocalDNSServer=1 for most circumstances satisfy the most common needs? (to use a local caching /forwarding server to do DNS lookups)
Why ???

The only "real" problem you solve with a local caching DNS over your ISP provided DNS is making your RBL lookups trustworthy - and if you fix that for hMailServer ... What about RBL lookups from SpamAssassin?

The "downside" of using a local caching DNS is that you can actually access pages like https://www.trillonario.com/ and PirateBay without your ISP blocking or tracking you... :mrgreen:
If I am not mistaken there some 87 sites blocked from users in Denmark by ISP's.

Also... If you use a local caching DNS you can eliminate the DNS Cache in Windows that is causing issues from time to time. The cache is only there to minimize DNS traffic over your *> Internet <* connection and a local caching DNS Server is just that - "A Local Cached DNS" for everyone on the LAN.

Anyways, hMailServer runs on Windows Server OS'es in most cases and it comes with a built-in DNS ready to use :idea:
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Add DNS server setting [90%]

Post by RvdH » 2021-06-25 16:19

SorenR wrote:
2021-06-25 16:08
Why ???
bypass URIBL_BLOCKED for SURBL lookups mainly... if i can make my hmailserver instance use the bind9 instance on my ubuntu-server uribl lookups are unblocked, and then it uses the same DNS server as spamassassin

But this also could be useful if you run spamassassin on the same windows box and have Bind9 as local caching/forwarding server
  1. faster DNS lookups
  2. lookup URIBL entries without being blocked because of using public and/or your ISP DNS
  3. you can use one DNS server for all application using it
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Add DNS server setting [90%]

Post by SorenR » 2021-06-25 16:48

RvdH wrote:
2021-06-25 16:19
SorenR wrote:
2021-06-25 16:08
Why ???
bypass URIBL_BLOCKED for SURBL lookups mainly... if i can make my hmailserver instance use the bind9 instance on my ubuntu-server uribl lookups are unblocked, and then it uses the same DNS server as spamassassin
Just change the DNS IP address in your network settings ...

I have a local caching DNS and it is also hosting my domain (private part). The public part is hosted in US.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Add DNS server setting [90%]

Post by RvdH » 2021-06-25 17:00

SorenR wrote:
2021-06-25 16:48
RvdH wrote:
2021-06-25 16:19
SorenR wrote:
2021-06-25 16:08
Why ???
bypass URIBL_BLOCKED for SURBL lookups mainly... if i can make my hmailserver instance use the bind9 instance on my ubuntu-server uribl lookups are unblocked, and then it uses the same DNS server as spamassassin
Just change the DNS IP address in your network settings ...

I have a local caching DNS and it is also hosting my domain (private part). The public part is hosted in US.
I might have something else on my system that doesn't allow me to change my network adapter settings
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Add DNS server setting [90%]

Post by SorenR » 2021-06-25 17:12

RvdH wrote:
2021-06-25 17:00
SorenR wrote:
2021-06-25 16:48
RvdH wrote:
2021-06-25 16:19


bypass URIBL_BLOCKED for SURBL lookups mainly... if i can make my hmailserver instance use the bind9 instance on my ubuntu-server uribl lookups are unblocked, and then it uses the same DNS server as spamassassin
Just change the DNS IP address in your network settings ...

I have a local caching DNS and it is also hosting my domain (private part). The public part is hosted in US.
I might have something else on my system that doesn't allow me to change my network adapter settings
Then you should add the option of entering the IP address of the preferred DNS in the GUI and if blank use the Windows DNS client. Make it one of the "cached" settings so only to query at startup. Also when saving new IP into GUI you should make hMailServer restart like when pressing [Save] in SSL/TLS settings.

EDIT.... 2 DNS IP's ? Primary Preferred and Secondary Preferred? If Primary &/ Secondary Preferred not available use Windows DNS Client?
Last edited by SorenR on 2021-06-25 17:16, edited 1 time in total.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Add DNS server setting [90%]

Post by RvdH » 2021-06-25 17:15

i should do whatever i prefer....
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Add DNS server setting [90%]

Post by SorenR » 2021-06-25 17:17

RvdH wrote:
2021-06-25 17:15
i should do whatever i prefer....
If it is only for you then don't ask us... ;-)
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Add DNS server setting [90%]

Post by RvdH » 2021-06-25 17:25

SorenR wrote:
2021-06-25 17:17
RvdH wrote:
2021-06-25 17:15
i should do whatever i prefer....
If it is only for you then don't ask us... ;-)
if you look at this post there is/was a need for it, so a INI setting will do and there is no need for GUI changes or whatever

And if we are talking about things that do not contribute, who invented DNS_QUERY_BYPASS_CACHE addition? You created a GUI option for that? :mrgreen:
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Add DNS server setting [90%]

Post by SorenR » 2021-06-25 18:08

RvdH wrote:
2021-06-25 17:25
SorenR wrote:
2021-06-25 17:17
RvdH wrote:
2021-06-25 17:15
i should do whatever i prefer....
If it is only for you then don't ask us... ;-)
if you look at this post there is/was a need for it, so a INI setting will do and there is no need for GUI changes or whatever

And if we are talking about things that do not contribute, who invented DNS_QUERY_BYPASS_CACHE addition? You created a GUI option for that? :mrgreen:
It was either the ini file setting or the change in Windows Registry 8)
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Add DNS server setting [90%]

Post by RvdH » 2021-06-25 21:20

So basically the same as this, it is either an INI setting or changing network adapter settings😋
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Add DNS server setting [90%]

Post by SorenR » 2021-06-26 18:03

Are you close to Johan Cruijff ArenA in Amsterdam?

I am told the ATM's in Amsterdam are bi-lingual tonight ... Nederlandse & Dansk :mrgreen:
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Add DNS server setting [90%]

Post by RvdH » 2021-06-27 12:14

If you live in the Netherlands everything is relatively close :mrgreen:
Amsterdam would be approx. a 1,5h drive, i live in the south close to Belgium border

Massive win for Denmark (although yesterday i had other things to do, so not have seen it live for the first time)
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
mattg
Moderator
Moderator
Posts: 22435
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Add DNS server setting [90%]

Post by mattg » 2021-06-28 01:22

RvdH wrote:
2021-06-25 13:22
Trying to implement this, as it would be cool to change this without having to change my network adapter settings
bill's solution works partially, eg: it works with a single DNS server IP4 address only (see: https://github.com/Bill48105/hmailserve ... solver.cpp)
I set my networking to use first my Ubuntu server with SpamAssassin and Bind9 as DNS, and then as subsequent DNS I use public DNS

I find that my lookups to nerds.dk don't always work without using my local DNS

Do I need a separate DNS for hMialserver? = NO

If there was one, it would need multiple IPv4 and IPv6 entries.
Most networked devices won't allow just a single DNS anyway, and probably for good reason
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Add DNS server setting [90%]

Post by RvdH » 2021-06-28 10:24

I have my raspberry pi setup with AdGuard Home to handle all my DNS traffic.
Besides that i have a ubuntu VM instance running bind9 and spamassassin that doesn't make use of AdGuard Home (bind9 is setup as caching/forwarding server)
Then on my Windows box i have ClamAV and hMailServer

A setting like this could be useful to force hmailserver to use the same (local) DNS server (eg the same that spamassassin uses) without being forced to install bind9 on the Windows box as well

I have found a few DNSBL/URIBL list to not work with public DNS, eg:

Code: Select all

/* Disable forwarding for DNSBL queries */

zone "multi.uribl.com" { type forward; forward first; forwarders {}; };
zone "multi.surbl.org" { type forward; forward first; forwarders {}; };
zone "list.dnswl.org" { type forward; forward first; forwarders {}; };
zone "all.spamrats.com" { type forward; forward first; forwarders {}; };
I don't think ipv6 is supported in built-in dnsapi, nor was i able to define multiple ipv4 dns server addresses
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Add DNS server setting [90%]

Post by SorenR » 2021-06-28 13:13

I also have two internal DNS servers. Primary is Windows 2019 Essential and secondary is my Synology NAS (DS209+II) running DNSMasq on BusyBox - Yes I know ... Antiquated, but it works 24/7/365. One DNS is using my Fiber connection and the other is using my 4G connection :mrgreen:

I have no ad-blocking DNS... We all use uBlock Origin for both Chrome and FireFox. IE and Edge exists only since we can't uninstall them safely!

Safari is tolerated ... for now.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

Post Reply