Upvote:2
I am assuming from your query that you are from a country which does, in fact, require a visa to visit Ireland (e.g. not EU national).
A visa for visiting the UK does not, obviously, extend to visiting the Republic of Ireland. That said, due to the open border between Ireland and Northern Ireland, you can travel freely across from NI to the RoI and, unless you break a law and are detained by the police, you are free (but not legally entitled) to move around Ireland without fear of being deported.
In your case, however, as you are planning on landing in Dublin, you must apply for an Ireland visa. There is no facility to transit from Dublin to Belfast without entering the Republic of Ireland by which I mean "exiting the port of entry" (there are no direct flights), nor will immigration accept an excuse of "but I'm planning on getting a bus!". I do know someone who went to Ireland (Indian citizen with a UK visa) who thought he didn't need a visa - after a 30 minute detention, he was allowed to enter Ireland with a warning, but that should not be considered the official position of Irish border police!
As you don't qualify for a transit visa, then a shortstay visa would be required. Have a look here for more info: http://www.inis.gov.ie/en/INIS/Pages/Transit%20visas