Yes, you will have to pay tax on the gain, then receive a deduction for the contribution if you have earned income to use for the contribution. Selling a capital asset is not considered earned income and is, therefore, not eligible for a pretax contribution to an IRA. Without other earned income, you will receive no deduction for the IRA contribution.
The only way this would work differently is if you file a Schedule C for the business of owning and selling domain names or you sold a business using this domain name and have earned income form that business prior to the sale.