I feel, that 市の名前 as [name of the city] is somewhat unnatural, but I can not explain to myself why I should use 都市の名前 instead. Jisho says that 市 is a noun and no restriction to use it.
Maybe the problem is just in sounding?
For example, if we use 市の名前 it is ok in written text but in speech it becomes [shi-no-namae] = [name of death] or [itchi-no-namae] = [name of one], and only for that reason Japanese use 都市の名前 which produces nicely [toschi-no-mae] = [city's name] = [name of city].
Is that logic right?