US President Donald Trump dismissed the prospect of talks with North Korea as a waste of time a day after his secretary of state said the United States was maintaining open lines of communication with North Korean leader Kim Jong-un.

"I told Rex Tillerson, our wonderful secretary of state, that he is wasting his time trying to negotiate with little rocket man," Trump wrote on Twitter, using his sarcastic nickname for Kim and seeming to contradict the top US diplomat.

Trump, who has traded insults and threats with Kim in recent weeks amid escalating tensions over Pyongyang's nuclear and missile programmes, later tweeted that his White House predecessors, Bill Clinton, George W Bush and Barack Obama, had all "failed" on North Korea by "being nice to rocket man".

"So why would it work now?" he asked.

READ MORE: North Korea vows to become a 'state nuclear force'

Kim succeeded his father, Kim Jong-il, as North Korean leader in 2011, during Obama's administration. Previous presidents negotiated with Pyongyang but ultimately failed to prevent it from pressing ahead with its internationally condemned weapons programmes.

Tillerson disclosed on Saturday that the US was directly communicating with North Korea on its nuclear and missile programmes but Pyongyang had shown no interest in dialogue.

"Save your energy Rex, we'll do what has to be done," Trump said.

A senior Trump administration official, asked for clarification about Trump's tweets, played down the significance of the communication channels.

"At a time when North Korea is continuing its provocations, the president does not think now is the time to negotiate with them," the official said, speaking on condition of anonymity.

RC Hammond, an adviser to Tillerson, denied his boss had been undercut by Trump's tweets and rejected any suggestion the secretary of state should resign.

"Let's resign the idea of resignation. The president just made it clear to the Kim regime the diplomatic offer on the table is cooling," Hammond said on Twitter.