The visa policy of Somalia dictates the use and acquisition of visas in Somalia. In accordance with the law, citizens of all countries require a visa to visit Somalia.
Holders of passports issued by any country can obtain a visa on arrival for a maximum stay of 30 days (extendable once), provided an invitation letter issued by the sponsor has been submitted to the Airport Immigration Department at least 2 days before arrival.
Somaliland and Puntland have completely different visa policies and do not recognize national visas.
References
Visa policy of Somalia Wikipedia(Text) CC BY-SA