The NL East champions announced the deal with the free agent on Monday.
The 29-year-old Duke joined the Nationals as a minor league free agent in March, spending most of last season at Triple-A Syracuse. He was 1-0 with a 1.32 ERA in 13 2/3 innings over eight appearances as a reliever for Washington after being called up in September.
For his major league career, Duke is 49-74 with a 4.52 ERA in 189 games, including 168 starts, across eight seasons with three clubs. He was an NL All-Star in 2009.