I came across this sentence which confused me:
どう言う苗字を付けようかと思った時,...
I didn't understand how 言う describes a word like 苗字 better. Now I started to think backwards about it.
So if one was to start with a sentence that had と言う苗字, と言う名前, と言う意味 a「quote」would precede the phrase. If と gets replaced with どう, there obviously can't be a quote preceding it. However the sentence could have been 「山田」と言う苗字を付けようかと思った時,... → When they were thinking about taking the name yamada. And now it is → When they were thinking which name to take. The thing that got me is, that that means the 言う "belongs" more to the どう than the 苗字.
Is it ok to think about it like that?