Having a good many ancestors from a variety of places within what was then the Holy Roman Empire, the way I solve such problems is to go to the wikipedia. org article for the city or village in question and read the history sub-section for the city. Whatever political unit was in power in the city at the DOB I list, then HRE, then the current status of the place in parentheses. I consider listing the POB as a means 1) of learning history, which can give an idea of the life of the profile subject, and 2) where possible birth or other records MIGHT be found.
I have an ancestor who was born around 1620 in the city of Stettin (we assume, the name is badly misspelled or transliterated). This was in the HRE at the time, but part of the Duchy of Pomerania, which was loosely allied with the HRE, and which would explain an ancestor of "Dutch" ancestry (the Netherlands was in the process of emerging from the HRE at the time) being able to go from Stettin to the Netherlands (Plattdeutsch or something close to it and to what is now Niederlandse being sort of a lingua franca along the North Sea and HRE-controlled Baltic Sea coasts). He took off for what is now New York in about 1640, just when the 30 Years' War was re-shaping the map of Europe. Now Stettin is Polish territory; the Duchy of Pomerania did not long survive the 30 Years' War.
The HRE WAS a cohesive political unit at one time, but the course of history, especially the 30 Years' War (ended 1648) battered its unity steadily. Parts of it more or less became "independent", and even fought against each other at times, but it still remained until 1806, at least as a construct, if a powerless one.
The HRE had NO continuity with the earlier Roman Empire of the Caesars: such could be attributed to the Byzantines, like Edward Gibbon did, but even that Empire changed so much during the 500-800s A.D. that few would really consider it the same political unit. The Roman Empire of the Caesars is considered to have officially "ended" in 476 A.D., but if one reads the histories of the areas involved, it was not so simple even as that. What became the "HRE" were the territories which the ethnic-German Ottonian rulers were able to conquer around 1000 A.D. These included Rome, and the idea of "Rome" in an empire's name lent prestige and moral authority to rule to the polity of the day. But the city of Rome played only a relatively small part in the politics of the empire, mostly being a bone of contention between the germanic northerners and the local "Italianoids" who wanted more autonomy.
History has not treated political units in the ways in which we consider them today, especially in Europe. Some sub-divisions of "Empires" were at odds with and stronger than the purported rulers of the Empires themselves. Boundaries were flexible at best and often disputed. Loyalties of sub-rulers would come and go like the seasons. Often religious beliefs of the rulers, family connections, or even ethnicities would play a bigger role in the politics of an area than would the official nomination.