Reproviding an IPNS record without changing it

Is there a way to provide an existing IPNS record to the DHT? Something like ipfs dht provide /ipns/12D3KooWNRMhSBESu5LWDpgce9h9mAs6yvUsXxBSJsvdmWdbeans (although that doesn’t work or I wouldn’t be posting this)

For example, I can ipfs dht provide QmY7GAExYqoty36cmaWbU28u7JbAtYPHcBxzZgE6rH6vk2 to manually re-announce a file to the network rather than waiting for someone to ask me if I have it.

The documentation is a bit confusing about how long IPNS records are stored, but it seems like they’re stored forever on the publishing node as I can still access that key and I published it well a few weeks ago and it’s still resolving.

Confusingly, my node seems to ask the entire DHT if it has a newer version of the record every time I do ipfs resolve on the IPNS key, despite being the only node that has ever held the private key for that PeerID. It seems like this is what’s causing a lot of IPNS-related slowness.

There probably needs to be a way for the node to say “not only is this IPNS record good for 24 hours, but if you see it within 3 hours, you can just stop searching and accept it rather than continuing to search for a newer version.” (If this is what IPRS is, I should take another look at it.)

I don’t think this will be supported until this issue is closed.

You’re right that it’s looking for newer versions. It doesn’t know a priori that if it tries to look up a newer version in the DHT it won’t find one – since private keys for publishing can be shared.

I don’t know of a way to say “anything within the last 3 hours is fine”, but you can do a couple of things to speed up name resolution if you don’t care about the newest record.

# stream DHT entries as they're returned
ipfs name resolve --stream /ipns/...

# look for 2 records from the DHT to resolve the address, and only take up to 5 seconds
ipfs name resolve --dhtrc 2 --dhtt 5s /ipns/