adverb
Expresses a vague, unarticulated feeling or reason; often used adverbially with に (なんとなしに). Similar to なんとなく, but slightly more literary or introspective.
See also: なんとなく
なんとなしに空を見上げた。
I looked up at the sky for no particular reason.
彼の話はなんとなしに悲しく感じられた。
His story felt somehow sad.
More common and colloquial; なんとなし is slightly more literary and often used in written or introspective contexts.
Compound of 何と (nanto, 'what') + 無し (nashi, 'without'). The exact derivation is uncertain, but it likely developed as an adverbial phrase meaning 'without any particular reason'.