I really liked staying at Trinity College's on-campus housing that is offered to tourists during the summer months. You can't get a more central location. The Book of Kells is right on campus, Grafton Street, Merrion Square, Temple Bar, O'Connell Street all within a very short walk. It's a great experience being able to be on the main campus at night after all the crowds have gone. They offer a free continental breakfast (more than ample) in their dining hall (which looks like Hogwart's from Harry Potter) with an option to get a full, hot breakfast if you pay a small amount, and there is also coin-op laundry facilities on-site, enabling you to pack lighter as you can do a load of wash in between Dublin and Belfast. Do understand that there are some lodgings offered that are part of Trinity, but are in buildings outside of the main campus, and not all rooms have full ensuite bathrooms (some are just a sink in the room with the toilets and showers down the hall).
In Belfast I have done something similar, staying at Queen's University Elms Village campus. The campus buildings there are not historic, but all their rooms had full ensuite bathrooms (sink, toilet and shower). Similar amenities on campus such as coin-op laundry (except the free breakfast served was a full hot one), plus they provided access to communal kitchen facilities so you could store snacks, drinks or cook a basic meal. Queen's University was within easy walking distance to the Ulster Museum and the Botanical Gardens, as well as a number of restaurants and shops. Other sightseeing (and the train station) was a quick taxi or bus ride away, or you could walk there in about 30 mins (about 1.5 miles to the city center).