The Nationals have agreed to terms with free-agent slugger Adam Dunn on a two-year, $20 million deal. An official announcement could come as early as Thursday.