This is likely a BIOS problem.
If you restored factory defaults, the BIOS may have reset to a default configuration as well, one that may not include a setup for your CD drive. Assuming this is what happened, here are some steps to try to get it working again. Note that the pictures are from my computer, and what you will actually see will depend on yours, but it will often be similar.
1. Shut down your system if turned on.
2. Immediately after turning on your computer, look for instructions for 'Setup' or 'Configuration'. There will be the name of a key to press; often this is one of the F keys, such as F2, F5, or F12, or the DEL or ESC key. It varies from computer to computer. You must press the setup key before the screen advances. If you miss the prompt, simply reset your computer and try again. This will open the BIOS menu.
3. Look for 'Drive Settings', 'Drive Configuration', or otherwise a block of settings referring to "Primary," "Secondary," "Master," and "Slave" drives, and use the keyboard to navigate the menus to get there. Be sure you read the instructions at the bottom of the screen so that you know which buttons to press.
4. Again paying attention to the controls at the bottom of the screen, make sure each drive is set to AUTO. If that setting isn't available, try setting either the Primary or Secondary (whichever one shows no drive) to CD or CD/DVD.
5. Press the ESC button or see the instructions at the bottom of the screen to learn how to exit your BIOS. Make sure you select Save/Exit from the list of choices. If you accidentally change any other setting, simply choose Exit (do not save), and you will be put back at the boot screen. You may then try again.
I hope this helps. Good luck!