mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-25 09:25:56 +03:00
[GH-ISSUE #5] Is there a way to implement failover if a primary server does not accept the request? #6
Labels
No labels
bug
confirmed
discussion
duplicate
enhancement
feature
feature-request
not-planned
pull-request
secondary-feature
stale
triage
waiting-feedback
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/dns-proxy-server-mageddo#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MostHated on GitHub (Sep 22, 2016).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/5
Hello,
I was wondering if there was a way to have multiple A records for a domain, and then if it detects that the first proxy IP is down, it can then failover and send the request to the second A record IP in the records file?
Thanks!
@mageddo commented on GitHub (Sep 22, 2016):
@MostHated If I understand you question you want to have many
Arecords atrecords.jsonfile.I don't know if you have tested it but In fact this is possible and should be working (as I saw at the code). Because when the browser (or whatever) receive a
Arecord list then it try one by one looking for a working recordIt happen at the
response.answer.push(dns[record.type](record));instruction in resolveDnsLocally function inapp.jsfileIf it is not working please let me know and if possible create a pull request fixing it :)
@MostHated commented on GitHub (Sep 23, 2016):
I will definitely have a go at it tomorrow and let you know, thank you much for the info!
@mageddo commented on GitHub (Sep 23, 2016):
You are welcome
@MostHated commented on GitHub (Sep 23, 2016):
The best way to test I suppose would be to put in 2 A records, with the first one working and the second working but at a different IP, then take the first IP, change it so that it is not working, then it should still work because it ends up going to the second one automatically?
@mageddo commented on GitHub (Sep 23, 2016):
Of course, I think that is. Anyway if you are using linux you can use
nslookupcommand to find whatArecords was returned from the DNS Server, something like bellow:or specifying what DNS Server you want to use
As you can see stackoverflow.com have many servers to the same hostname, Google Chrome for example will try one by none
website ip extension shows what address Chrome have resolved at the domain.
Remember that Chrome have cache for DNS names, so CTRL + F5 is your friend
@MostHated commented on GitHub (Sep 23, 2016):
When I do both dig and nslookup for it, I get
`Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: mysite.com
Address: 1.1.1.1
`
but, when I go to actually type the address in the browser, I never see the hit reach my server of 1.1.1.1, it seems to never leave the DNS box, to hit my web hosting box.
Am I supposed to also have these entries here? Here is what my file looks like just trying to get it to work normally.
[
{
"records": [
{
"type": "A",
"address": "1.1.1.1",
"ttl": 300,
"name": "mysite.com"
}
],
"domain": "mysite.com"
},
{
"records": [
{
"type": "A",
"address": "127.0.0.1",
"ttl": 300
"name": "ns1.mysite.com"
}
],
"domain": "ns1.mysite.com"
}
,
{
"records": [
{
"type": "A",
"address": "127.0.0.1",
"ttl": 300
"name": "ns2.mysite.com"
}
],
"domain": "ns2.mysite.com"
}
]
As I have my DNS servers from my actual domain host pointed to this server
@mageddo commented on GitHub (Sep 23, 2016):
Ok.. Are you checking the logs? They say that dig is asking dns-proxy-server ? Are you running from docker or with npm?
Looks like dig is not resolving from dns-proxy-server because his say that have used
8.8.8.8.if you runned it from npm make sure that your
/etc/resolv.confhave something like that:Also make sure that you are running
npm startas sudo.Any way I think that your records.json need to looks like that
@MostHated commented on GitHub (Sep 26, 2016):
I am using npm, I was doing the command "dig mysite.com @127.0.0.1", I made sure to change my nameserver to 127.0.0.1 as well
@mageddo commented on GitHub (Sep 26, 2016):
Anyway it is not working?
@mageddo commented on GitHub (Sep 26, 2016):
If not please describe your problem as below, then I will test it and mark as bug and try to solves.
I know that is boring to describe but is good to make sure that we are talking about the same thing .
The functionality with problem:
Expected behavior:
Currently behavior:
How simulate this scenario?:
Evidences: (print/output)
@MostHated commented on GitHub (Sep 29, 2016):
Sorry about this, I have been quite busy with work the last few days. I will try to get this information over to you as soon as I can!
Thanks for the assistance.
@mageddo commented on GitHub (Sep 29, 2016):
No problem guy, ask as you need.