This code worked for me.
It was done with the terminal utility.
It seems there was code that was included in the O/S to dissuade the creation of optical discs though.
The reason being that during the installation,toward the end of the boot process it freezes.
As Nocturnius states, you can't boot from the DVD on real hardware using the method he describes as it always freezes before it gets to the actual installer. However,
I did find instructions at MacPlanete that create a perfectly bootable DVD (at least on real hardware -- I didn't try it on a VM) but it is all in French so I have attempted to summarize/translate it into English using my less-than-stellar French skills. I can't take any credit for the following because I didn't figure it out on my own, but it worked beautifully for me using my Mavericks machine and the 10.11.2 Mac OS X El Capitan installer. The main difference that I see between the instructions I've seen on other posts in this thread and the one on MacPlanete is that the MacPlanete method adds a new text file to the installer DVD. So, here it goes...
Download the El Capitan installer from the App Store and leave it in the default /Applications folder.
We will be doing the rest with Terminal (it's in the Applications/Utilities folder) so open it and enter the commands listed below into it.
Create a DMG image file to hold all the files we need to create the DVD. At least with the El Capitan 10.11.2 installer, 7 GB will be big enough
hdiutil create -type UDIF -size 7g -fs HFS+J -volname ELCAPITAN ~/Desktop/DVD
Now mount our DMG image.
hdiutil attach ~/Desktop/DVD.dmg
Copy the El Capitan installer to the DMG image file
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/ELCAPITAN --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction
In order for our install DVD to boot properly, we need to add one new file. You can either download it from the MacPlanete page linked above or just make your own, so for the sake of completeness, that's what we'll do here.
Create a text file with any text editor (
like BareBones free editor Text Wrangler). Name it "IAProductInfo.txt" and save it to the Desktop. Note that you cannot use a word processor like Microsoft Word to make this file. It must be pure text file. The file must contain the following:
{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf130
{\fonttbl\f0\fmodern\fcharset0 Courier;\f1\fnil\fcharset0 Menlo-Regular;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\deftab720
\pard\pardeftab720\sl280\partightenfactor0
\f0\fs24 \cf2 \expnd0\expndtw0\kerning0
\outl0\strokewidth0 \strokec2 <?xml version="1.0" encoding="UTF-8"?>\
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\
<plist version="1.0">\
<dict>\
<key>Product URL</key>\
<string>x-osproduct://
\f1\fs22 \cf0 \kerning1\expnd0\expndtw0 \CocoaLigature0 \outl0\strokewidth0 6DA1834B-B2D1-350A-ABD8-217C369EB5E0
\f0\fs24 \cf2 \expnd0\expndtw0\kerning0
\CocoaLigature1 \outl0\strokewidth0 \strokec2 /OS%20X%20Install%20Data</string>\
</dict>\
</plist>}
(NOTE: The MacPlanete author also described a way to auto-generate this file, but it didn't work for me.)
Copy the file we just created to our DMG image file:
cp ~/Desktop/IAProductInfo.txt /Volumes/Install\ OS\ X\ El\ Capitan/.IAProductInfo
Unmount Apple's original El Capitan installer
hdiutil detach /Volumes/Install\ OS\ X\ El\ Capitan/
Finally, burn it to a Dual Layer DVD (it won't fit on a regular DVD so it has to be dual layer)
hdiutil burn ~/Desktop/DVD.dmg