What you are looking for is large depth of field. This is an optical property, not something applied as a special effect, so it's not something you can turn on or off. The raw image capture the light focused by the lens, and inevitably there will be parts of the scene out of the range where the rays are tightly organized by the lens. In fact, the fashion of shallow depth of field with blur as a key compositional element is relatively recent — traditionally, many photographers' concern was the same as yours: getting more of the scene in focus.
The good news is that you can affect this: a smaller aperture will give you greater depth of field. That means larger f numbers, like f/16 or f/22. This won't give you infinite focus, but will greatly increase the range which appears sharp. The "price" is that you'll need either higher ISO or longer shutter speed. For highest image quality, longer shutter is usually the better option — which is why tripods are common for landscapes.
For a given aperture, you can find the hyperfocal distance, which is the distance at which you can set the focus to get the largest depth of field. (There are a number of online calculators which can figure this out for you, although without an distance scale on the lens you kind of have to guess when focusing.)
If you use a pinhole lens the aperture will be so small that you will have effectively have infinite depth of field. But, with this approach, or even with any small aperture like f/11 or up, you sacrifice a little of the top possible sharpness of the in-focus area in exchange for greater overall depth across the scene.
Finally, there is an emerging field called "computational photography", where unfocused light rays are recorded without a traditional lens. With this approach, focus is applied after the fact, just as you were thinking. However, this technology is in its infancy — the only commercial camera to work this way is the Lytro, and its resolution is so low that it's really just a toy (and a sort of "tech preview").