Running gasses through dry ice is a good way to dry the gas as any water vapor will condense out and solidify at those temperatures. However, there is no way to liquify any atmospheric gases by just passing them through dry ice. Industrially, what they do is take a large sample of air and compress it. Then they decompress it, and recompress it again. The air sample goes through numerous cycles of compression and decompression which results in an intense drop in temperature. (Any time you decompress a gas it cools down temperature wise. If you have a can of condensed air and use it, you'll notice that it gets really cold as the high pressure gas escapes).
So by taking a sample of air and compressing it, then decompressing it, they drop the temperature of the air sample. The air sample continues to cool down at each cycle and soon it begins to liquify. More air is led into the tank and the procedure continues on indefinitely until there is so much liquid air inside that they can't compress any more.
Now, with all of the gases liquified, they slowly warm up the liquid air and as they do certain fractions boil off at certain points. These fractions are collected and isolated in order to get the different components of air.
If you want to play with liquid nitrogen, and you want to use it frequently, I would suggest investing in a Dewar Transportation Flask. These are specially designed for transferring liquid gasses and are the only equipment that gas companies like ABCO will legally put liquified gasses into. Mind you they are expensive, but the liquid nitrogen itself is dirt cheap.