That gets extremely complicated. My town straddles the border between 2 counties. And you can't trivially have subdomains for counties and cities at the same level, because Wyoming has a Laramie city but it's in Albany County, not the neighboring Laramie County.
Did this just inspire the next "Falsehoods programmers believe about... Federalism"?
This comes up with school districts too. My home county in rural Ohio had a school district administration that oversaw all the schools in the county but there are two 'exempted' school districts. One is a town that is split between two counties, so the school district would fall in two counties. Hence it is "exempted" from both and the official name is "<TOWN NAME> Exempted Village Schools". The other one if the largest town in the county, which due to it's size voted to exempt itself from the services and administration of the county government, presumably since this single school has as many students as the rest of the county combined.
Virginia cities are independent, not within counties. And there's both a Fairfax City and Fairfax County. Making things even more confusing, the county seat is Fairfax City despite the city not being part of the county. The county has fairfaxcounty.gov while the city has fairfaxva.gov.
There are a handful of other independent cities in the US, but the vast majority are in Virginia.
St. Louis is like this as well.