ipfs dht put /ipns/QmOfSample command needs an actual IPNS record as described in
ipfs dht put --help
The value must be a valid value for the given key type. For example, if the key
is /ipns/QmFoo, the value must be IPNS record (protobuf) signed with the key
identified by QmFoo.
This means that you’d need to actually construct or get the full IPNS record protobuf into a file and then
ipfs dht put /ipns/QmOfSample /path/to/ipns/record.
Why are you trying to do this instead of just doing
ipfs name publish? Is it because you’re concerned about how long it was taking? Doing
ipfs dht put will not make things go any faster as they both have to do puts to the DHT which is currently slower than we might like (unfortunately a good chunk of the DHT server nodes are still on go-ipfs <0.5.0 which had a number of significant DHT improvements, as more of those nodes update the network performance should improve).
What use case is causing you to be concerned about IPNS publishing performance? You might consider using IPNS over PubSub, while the
ipfs name publish command will still wait to return until the DHT publish is completed the PubSub publish will happen quite quickly.