Chris Clark, 43, accepted the offer from an anonymous bidder after a week-long online auction.
“It’s crazy, it’s just crazy,” Mr Clark, who lives in North Potomac, Maryland, was quoted as saying by the Baltimore Sun newspaper.
“It will make a significant difference in my life, for sure,” he added.
Mr Clark registered the domain name in 1994, when the world wide web was just starting.
He had hoped that pizza.com would help to get a contract with a pizza firm for his consulting company.
He sold his business in 2000, but kept paying the $20 annual fees for maintaining the domain, which he also used to sell advertisements.
In January, Mr Clark decided to sell it after hearing that another domain – Vodka.com – was sold for $3m in 2006.
“I thought, ‘Why don’t I just try to see what the level of interest is?'” Mr Clark said.
“If someone’s willing to pay that much for Vodka.com, maybe there’s more interest in pizza.com.”
The online auction was launched on 27 March. The first bid was $100, jumping to $2.6m a week later.
Having accepted the latter offer, Mr Clark hopes to get his windfall in a few days’ time when the transaction is completed.
He said he now regretted not buying more domain names in the 1990s.