164 countries have established diplomatic relations with North Korea

What exactly does "diplomatic recognition" mean?

In this context, "diplomatic recognition" means that a state has formally established diplomatic relations with the DPRK, and recognized it as a sovereign state in the international system. It does not include "de facto" recognition.

Do all countries that have recognized the DPRK have active diplomatic ties with Pyongyang?

No. Only 24 countries have embassies in Pyongyang. Many of the countries that have diplomatic relations with the DPRK base diplomatic staff handling North Korea at their embassies in Beijing or Seoul, but the North Korean government has not always permitted non-resident ambassadors to present their credentials in Pyongyang. Additionally, some countries have established policies limiting diplomatic contact with North Korea -- Canada, for example, has implemented a "Controlled Engagement Policy" toward North Korea since 2010, strictly limiting government-to-government cooperation and communication.

Have any countries formally broken their diplomatic ties with the DPRK?

Several countries have formally suspended or severed diplomatic relations with North Korea. During the 1970s, several countries severed relations with the DPRK when their governments switched Cold War alignments. In 1980, Iraq broke off relations with the DPRK due to North Korea's arms sales to Iran, and Myanmar "de-recognized" the DPRK in 1983 following the attempted assassination of South Korean President Chun Doo-hwan in Rangoon. (DPRK-Myanmar relations were re-established in 2007.) Most recently, Botswana terminated its diplomatic relations with the DPRK in 2014, following the publication of the United Nations Commission of Inquiry Report on Human Rights in North Korea.

Is there a formal North Korean presence in any countries with which Pyongyang does not have diplomatic ties?

Yes. There are DPRK Missions to UN offices in New York and Paris (North Korea has not established diplomatic relations with either the U.S. or France). The DPRK outpost in Paris has also served as a Trade Mission. 

Timeline of DPRK establishment of diplomatic relations

Country Date Relations Established Notes
Soviet Union 10/12/1948  
Mongolia 10/15/1948  
Poland 10/16/1948  
Yugoslavia  10/30/1948  
Romania 11/3/1948  
Hungary 11/11/1948  
Albania 11/29/1948  
Bulgaria 11/29/1948  
Czechoslovakia 1948  
China 10/6/1949  
East Germany 1949  
Vietnam 1/31/1950 Established relations with DRV prior to formal independence.
Algeria 9/25/1958 Established relations with FLN prior to Algerian independence.
Guinea  10/8/1958  
Cuba 8/29/1960  
Mali 8/29/1961  
Yemen 3/9/1963  
Egypt 8/24/1963  
Indonesia 4/16/1964  
Mauritania 11/12/1964 Relations suspended from 1977 to 1980
Congo Rep. 12/24/1964  
Cambodia 12/28/1964  
Ghana 12/28/1964  
Tanzania 1/13/1965  
Syria 7/25/1966  
Palestine 1966  
Burundi 3/12/1967  
Somalia 4/13/1967  
Iraq 1968 Relations severed in 1980
South Yemen 1968  
Equatorial Guinea 1/30/1969  
Zambia 4/12/1969  
Chad 5/8/1969  
Sudan 6/21/1969  
Central African Republic 9/5/1969  
Maldives 6/14/1970  
Sri Lanka 7/15/1970 Relations suspended from 1971 to 1975
Sierra Leone 10/14/1971  
Malta 12/20/1971  
Cameroon 3/3/1972  
Rwanda 4/22/1972  
Chile 6/1/1972 Relations suspended in 1973, later resumed
Uganda 8/2/1972  
Senegal 9/8/1972  
Burkina Faso 10/11/1972  
Pakistan 11/9/1972  
Madagascar 11/16/1972  
Zaire 12/15/1972  
Togo 1/31/1973  
Benin 2/5/1973  
Gambia 3/2/1973  
Mauritius 3/16/1973  
Sweden 4/7/1973  
Iran 4/15/1973  
Finland 6/1/1973  
Norway 6/22/1973  
Malaysia 6/30/1973  
Denmark 7/17/1973  
Iceland 7/27/1973  
Bangladesh 12/9/1973  
India 12/10/1973  
Liberia 12/20/1973  
Afghanistan 12/26/1973  
Argentina 1973 Relations severed in 1977
Libya 1/23/1974  
Gabon 1/29/1974  
Costa Rica 2/10/1974 Relations severed, date unclear
Guinea-Bissau 3/16/1974  
Nepal 5/15/1974  
Guyana 5/18/1974  
Laos 6/24/1974  
Jordan 7/5/1974  
Niger 9/6/1974  
Jamaica 10/9/1974  
Venezuela 10/28/1974  
Austria 12/17/1974  
Switzerland 12/20/1974  
Botswana 12/27/1974 Relations severed in 2014
Australia 12/31/1974 Relations suspended from 1975 to 2000
Fiji 4/14/1975 Relations suspended from 1987 to 2002
Portugal 4/15/1975  
Thailand 5/8/1975  
Kenya 5/12/1975  
Ethiopia 6/5/1975  
Mozambique 6/25/1975  
Tunisia 8/3/1975  
São Tomé and Principe 8/9/1975  
Cape Verde 8/18/1975  
Singapore 11/8/1975  
Comoros 11/13/1975  
Angola 11/16/1975  
Burma 1975 Relations suspended from 1983 to 2007
Western Sahara 3/16/1976  
Nigeria 5/25/1976  
Papua New Guinea 6/1/1976  
Seychelles 6/28/1976  
Barbados 12/5/1977  
Grenada 5/9/1979 Relations suspended in 1985, later resumed
Nicaragua 8/21/1979  
Saint Lucia 9/13/1979  
Zimbabwe 4/18/1980  
Lesotho 7/19/1980 Relations suspended in 1986, later restored
Mexico 9/9/1980  
Lebanon 2/12/1981  
Vanuatu 10/1/1981  
Nauru 2/25/1982  
Malawi 6/25/1982  
Suriname 10/11/1982  
Côte d'Ivoire 1/9/1985  
Trinidad and Tobago 1/22/1986  
Columbia 10/24/1988  
Peru 12/15/1988  
Morocco 2/13/1989  
Namibia 3/22/1990  
St. Vincent and the Grenadines 8/16/1990  
Antigua & Barbuda  11/27/1990  
Dominica 1/21/1991  
Bahamas 5/16/1991  
Belize 6/20/1991  
Lithuania 9/25/1991  
Latvia 9/26/1991  
St. Kitts and Nevis 12/13/1991  
Cyprus 12/23/1991  
Ukraine 1/9/1992  
Turkmenistan 1/10/1992  
Kyrgyzstan 1/21/1992  
Kazakhstan 1/28/1992  
Azerbaijan 1/30/1992  
Moldova 1/30/1992  
Belarus 2/3/1992  
Tajikistan 2/5/1992  
Uzbekistan 2/7/1992  
Armenia 2/13/1992  
Oman 5/20/1992  
Slovenia 9/8/1992  
Croatia 11/30/1992  
Czech Republic 1/1/1993  
Slovakia 1/1/1993  
Qatar 1/11/1993  
Eritrea 5/25/1993  
Djibouti 6/13/1993  
Macedonia 11/2/1993  
Georgia 11/3/1994  
Bosnia and Herzegovina 1/19/1996  
South Africa 8/10/1998  
Brunei 1/7/1999  
Italy 1/4/2000  
Philippines 7/12/2000  
United Kingdom 12/12/2000  
Netherlands 1/15/2001  
Belgium 1/23/2001  
Canada 2/6/2001  
Spain 2/7/2001  
Germany 3/1/2001  
Luxembourg 3/5/2001  
Greece 3/8/2001  
Brazil 3/9/2001  
New Zealand 3/26/2001  
Kuwait 4/4/2001  
Liechtenstein 5/2/2001  
EU 5/14/2001  
Bahrain 5/23/2001  
Turkey 6/27/2001  
East Timor 11/5/2002  
Ireland 12/10/2003  
San Marino 5/13/2004  
Montenegro 7/16/2007  
United Arab Emirates 9/17/2007  
Swaziland 9/20/2007  
Dominica Rep. 9/24/2007  
Guatemala 9/26/2007  
South Sudan 11/18/2011