okTurtles / dnschain

A blockchain-based DNS + HTTP server that fixes HTTPS security, and more!
https://okturtles.com
Other
1.73k stars 170 forks source link

namecoin.dns resolves to internal ip address #47

Closed rnhmjoj closed 10 years ago

rnhmjoj commented 10 years ago

Should gExternalIP return the server's public ip address or dnschain is supposed to work only in the same network of the server?

taoeffect commented 10 years ago

It should return the server's public IP, but it might not if there's a special network setup. I can't help troubleshoot unless I know more info about the server's network settings.

rnhmjoj commented 10 years ago

I don't think i have a strange setup. The server is just connect to a wifi router which is also the gateway.

taoeffect commented 10 years ago

OK, well, it's possible that you're being given an internal IP by the router. That might be OK though, you just need to make sure that your router has the proper ports open and mapped correctly to that internal IP and port pair.

rnhmjoj commented 10 years ago

The server is a DMZ and has a DHCP reservation. Dnschain works fine except for namecoin.dns.

taoeffect commented 10 years ago

How are you accessing it? Try explicitly putting http:// in front of it.

If that doesn't work, try explicitly setting the server's IP in the config like so:

[dns]
externalIP = 123.123.123.123
rnhmjoj commented 10 years ago

I used dig to see what it resolves to. Try yourself: dig @95.236.82.147 namecoin.dns

taoeffect commented 10 years ago

Right, so in your config, do:

[dns]

externalIP = 95.236.82.147
taoeffect commented 10 years ago

*You'll need to restart DNSChain for it to notice any config changes.

rnhmjoj commented 10 years ago

Ok, this way it works but should't it pick the address on his own?

taoeffect commented 10 years ago

There's no simple way for it to know what that address is in your network setup. Your router hides that info from DNSChain. In some setups, the machine is given its public static IP directly instead of an internal one, in that case DNSChain does correctly figure it out.

One way to have it guess in all circumstances would be for it to connect to some "trusted central service", and have that service tell it what IP it sees, but we know how unreliable that can be... ;)

rnhmjoj commented 10 years ago

Ok, thank you.