If you take the destination nprofile1 instead of npub, the relay inside of the nprofile1 is the users outbox, which will have the most up-to-date relay list for DMs of that user. You can download that relay list and then send the DM there. :)
https://github.com/ksedgwic/privdm
I needed a command line tool to send a nip 17 private direct message
If you take the destination nprofile1 instead of npub, the relay inside of the nprofile1 is the users outbox, which will have the most up-to-date relay list for DMs of that user. You can download that relay list and then send the DM there. :)