The two sides met in last season's Third Qualifying Round, Celtic winning 3-2 on aggregate.
The first leg match of the play-off stage will be held either on August 15 of 16 and the second leg will be played on August 22 or 23.
Now they face a long journey for the away leg of their playoff round tie as FC Astana provide the opposition.
Should Hoffenheim make it through, they will learn their Champions League group opponents on Thursday 24 August. They have a lot of really good young players.
Liverpool open their league campaign against Watford on August 12 and will face the first leg of their playoff against Hoffenheim on either August 15 or 16.
Towering centre back Niklas Sule and midfield playmaker Sebastian Rudy both agreed to join Bayern midway through last season and they will both be extremely hard to replace.
Nagelsmann is quoted by the Liverpool Echo as saying: "This morning I joked by saying "if you want to lift the trophy you also have to overcome Liverpool" as I felt it would be Liverpool".
"We need to be independent of one or two players", he said. I had a feeling it would be Liverpool and I think it's a great thing for both our fans and the media. I believe they would not have necessarily picked us as their opponents.
"Liverpool is an outstanding team, Bayern Munich was unimpressive".
Liverpool were denied a meeting with Mario Balotelli's Nice, who had the toughest draw in landing Napoli, but will be wary of an impressive Hoffenheim outfit.
- White House leaks are 'threatening national security', Jeff Sessions says
- Vice President Election 2017: Voting underway
- Aamir Khan's Secret Superstar trailer OUT
- Robert Pattinson shares a wild story
- Maduro says company's vote claim part of United States plot
- Martin Shkreli Found Guilty On 3 Counts, Including Securities Fraud
- Samsung Galaxy S8 Active accidentally confirmed by AT&T?
- England opt to bat in 4th Sth African Test
- Coordinating with Bhutan on Dokalam issue
- Jay Cutler Unlikely to Join Miami Dolphins