iotaledger / iri

IOTA Reference Implementation
Other
1.15k stars 370 forks source link

getNeighbors return more neighbors than actually added #373

Open pinpong opened 6 years ago

pinpong commented 6 years ago

While a connected neighbor switched the server and played with different ip/dns IRI return more neighbors than actually added.

MClarkDev commented 6 years ago

If I add a neighbor

tcp://1.2.3.4:15600

But if the reverse resolves:

nslookup 1.2.3.4 the.reverse.addr

I will sometimes see a second host appear in the list:

tcp://the.reverse.addr:15600

mettenian commented 6 years ago

I reported this problem in June ;-) https://github.com/iotaledger/iri/issues/149

goligo commented 6 years ago

I have also seen this twice on my node, that multiple IPs were listed as neighbors, which are not in my configuration and I have addNeighbors listed in remote-limit-api.

goligo commented 6 years ago

I have reproduced this issue again - usually it just happens if the IP of a hostname is changed, which happens very seldom. However, in case someone is using dynamic DNS services and provides the hostname, an additional neighbor entry will be created, whenever the IP is changed and the new IP has a different reverse lookup name. This is causing my node to have 83 neighbors, 76 of them just being old IPs of one of my actual neighbors, which will get a lot of UDP traffic from my node.