Let me point out first that there are also addresses that the US Post Office doesn't deliver to at all. Not even to a common mail receptacle or group of mailboxes. Certainly anyone can get a PO box at the nearest Post Office. Many times, a remote, or extremely rural address will still be serviced by UPS or Fedex.
The USPS designates each ZIP Code with a "type" to help them sort mail more quickly. The "type" can be any of the following:
S - Standard - A "standard" ZIP Code is what most people think of when they talk about ZIP Codes - essentially a town, city, or a division of a city that has mail service.
P - PO Box Only - Rural towns, groups of towns, or even high-growth areas of cities are given a "PO Box Only" ZIP Code type.
U - Unique - Companies, organizations, and institutions that receive large quantities of mail are given a "unique" ZIP Code type.
M - Military - Military bases overseas - and often vessels and ships - are given a "military" ZIP Code type.
It sounds like you want to find the ZIP Codes with "P" type, meaning they service a PO Box only. There are many ZIP Code database services. Ones that I have worked with in the past is zip-codes or zipinfo. They offer A LOT of metadata about ZIP Codes.
Keep in mind, that a ZIP Code can span multiple cities, counties, and even states. Yes, there are some ZIP codes that exist in multiple states. That is because a ZIP code is not a physical boundary but a postal route designed with convenience and efficiency in mind. If there is a remote mountain road that is only accessible from a small town in Alabama but that road crosses over into Mississippi, the addresses on that road will be serviced by the post office (or ZIP Code) that is in Alabama.
Because of this seeming inconsistency, a 5 digit ZIP Code is not as valuable as a 9 digit (or ZIP+4) code. The ZIP+4 code designates a specific area, typically a city block or grouping of houses and so is much more precise. There are 42k unique ZIP Codes currently in use and that means that the possible number of ZIP+4 codes is 420 Million. Since there are only 300 Million mailing address in the US, that still leaves some room for growth.
To summarize, ZIP codes are USPS delivery areas, not necessarily matching any political borders. ZIP+4 codes are block-level delivery areas and in order to get a ZIP+4 for any given address you must process an address through an address verification service. (I work for one called SmartyStreets.)