Residential mechanical codes set real limits on how a dryer can be vented, and a surprising number of homes don't meet them, usually because of a well-intentioned DIY change. Here's the shape of the rules and the violations that turn up most.
The duct run should be smooth-wall rigid metal. Ridged foil and plastic accordion ducting catch lint in every corrugation, sag between supports, and are combustible in the case of vinyl. A short flexible metal transition between the dryer and the wall connection is generally permitted; the concealed run should not be flexible.
Codes cap the total developed length of the run, commonly on the order of 35 feet, and each elbow subtracts a meaningful amount from that budget, with tighter bends costing more. A run that looks short on the wall can be well over the limit once the turns are counted. Manufacturer instructions can permit longer runs where a booster is specified, but the default budget is easy to blow through in a two-story home.
In order of frequency: foil accordion duct used for the concealed run; a screen added at the vent hood to keep birds out; a run terminated into the attic; joints fastened with screws that protrude into the duct and snag lint; and duct taped rather than properly joined with foil tape at the seams. Sheet-metal screws through a dryer duct are a classic, every protruding tip becomes a lint collector.
Dryer venting shows up regularly on inspection reports in this market. If you're buying, look for it. If you're selling, it's a cheap fix relative to the negotiation it can trigger, and if the run has been non-compliant for years, it has almost certainly accumulated lint that needs clearing regardless.
Existing installations are often grandfathered, but the safety logic doesn’t change with the build date, and any replacement work should meet current code.
Local jurisdictions adopt and enforce the mechanical code, so specifics vary. Check with your city or county building department for the version in force.