add dns support inipfs p2p forward
and refactor code
#5533
Merged
ipfs p2p forward
and refactor code
#5533