How do I register a .bit domain name with Namecoin? I have several namecoins and would like to register a name.  That name could either be for TOR, DNS, or any other purpose.

What are the steps needed to spend these coins?
The algorithm of registering .bit domain is described, for example, on dot-bit wiki.

In short:


Create new domain name with name_new command: ./namecoind name_new d/&lt;name&gt;
Wait 12 or more blocks
Actually register the domain with name_firstupdate, where &lt;rand&gt; is the second (shorter) hexadecimal string returned by name_new, and &lt;json-value&gt; is the domain configuration (similar to DNS record): 


./namecoind name_firstupdate d/&lt;name&gt; &lt;rand&gt; '&lt;json-value&gt;'

The basic json-string, mapping the domain to the some IP looks like that:

'{"ip":"1.2.3.4", "tor":"123456.onion"}'


More on domain configuration