The decision has been taken in light of a rise in Covid-19 cases in the west of the region.
It will be reviewed on a weekly basis and there will be exemptions for visits to end of life patients and, where required, to support the wellbeing of someone with dementia or a learning difficulty.
NHS Dumfries and Galloway medical director Dr Kenneth Donaldson said: “The temporary suspension of inpatient visiting is intended to help limit any spread of coronavirus and protect vulnerable patients.
“When hospital inpatient visiting resumed in July on the basis of one designated visitor per patient it was noted that it might have to be suspended again at any point. While our very effective Test and Protect team address and monitor the situation, the decision to suspend visiting has been taken in order to protect patients, staff and services.
“We understand that suspending visiting will impact on families and patients, and we know that not being able to visit family members whilst they are in hospital may be upsetting.
“However, we hope that they will understand that we have made this decision in the best interests of our patients.”
Anyone visiting hospital is asked to continue to follow NHS Dumfries and Galloway’s hand hygiene and hand washing advice, to don personal protective equipment as directed, and not to visit if experiencing symptoms of flu, Covid, or if feeling generally unwell.