Last I heard, you were allowed to keep rifles in D.C., but not handguns.
You can have a shotgun in DC, if you pay the fee, but no handguns and no rifles are allowed. Trouble is, I can't remember the last time someone in DC was killed by a shotgun blast.
From the NRA-ILA:
Rifles and Shotguns A person may buy or sell a firearm only from or to a licensed dealer in the District. Delivery cannot be made until the registration certificate for the firearm is approved by the Metropolitan Police Dept. Ammunition may be bought only for the caliber or gauge of a firearm registered to the buyer.
...
All firearms must be unloaded and disassembled or locked with a trigger lock except when kept at a registrant`s place of business or while being used for lawful "recreational" purposes. A D.C. license to carry a pistol is needed for one`s home or business and the pistol must also have been registered prior to September 24, 1976.
Self-defense in one`s home with a firearm is therefore legally precluded.
+++++++++++++++++++++++++++++++++++++++++++++++++++++
They also indicate that in addition to the registration, which also functions as a permit to purchase, the prospective owner must be licensed.