Do I need a DI box?
If you want to record your guitar cab or combo, as well as the direct signal from your guitar pickup, you have a couple of options. You can split the signal between your guitar amp/combo using a DI box—your guitar plugs into the DI box, with one output going to your head/combo and the other going to an external mic pre or the mic pre built into your recording interface. Alternatively, if your DI box is active, you can run that second output into the line input of your recording interface, bypassing the built-in preamp. If your guitar amp is equipped with a direct output (not to be confused with the speaker output), you also have the option of ditching the DI box altogether. Recording from the direct out or emulated output is an excellent option if you have a full-featured amp, as you will be using a very powerful preamp and have access to all the gain and equalization controls available on the amp channel. As is the case with everything else in recording, it all comes down to intent. Try the options available to you, then trust your ears to make the decision.
Recording tip: Don't have an amp? Have neighbors who will complain? In these cases, you have a whole world of virtual guitar amp software plug-ins on the market at some very affordable price points. When recording using these plug-ins, consider adding a microphone (dynamic for close miking, a condenser for distance miking) on the strings of your electric guitar. You will be pleasantly surprised by the added impact and authenticity this can provide. This also applies when recording through a real amp. Add a mic for the guitar strings. You will dig the results.