My SQL Server instance is hosted on an internal network server (10.x.x.x address). It's a named instance currently using dynamic ports. An external application at a third-party hosting location connects to the instance through use of the IP address and port #. After each maintenance window I have to confirm the dynamic port # in use is the same as before as the firewall rule is set to allow connections between application host and database host on that specific port #.

Is this the correct way to ensure the externally-hosted app can connect to the host without having to change port numbers in the connection string or should another port forwarding method be used (i.e., port 9999 on application host is mapped to port 1434 on SQL host)? What configuration manager changes in the Network Configuration section should be applied to allow the external application to use the same port # but internal applications to rely on the Browser server to make the correct mapping?

  • All you need to do is switch to a static port. That's it.
    – Jon Seigel
    Nov 22, 2013 at 3:47

1 Answer 1


Not sure if I fully understand the question. But the internal applications should be fine about the port number unless there are also firewalls internally, in which case you just allow the port through there.

For the external access, I'd consider a static port so you can stop doing what you have to do. In an ideal world you'd only really expose your SQL Server to the web server itself externally, so if the firewall can just trust the webservers IP only that is a good thing to do only, instead of just being wide open for that port for any incoming traffic.

But you just ned to set an static port in the network config:

enter image description here

So instead of a 0 for dynamic ports, type a port number in for the TCP Port you wish to use.

  • Thanks Mike and Jon. I can understand setting the static port number so that the external app can use the same connection string indefinitely, but would would internal app that's using the server name for the connection string need to specify the port # going forward? I'm under the impression that the Browser service will handle forwarding requests to the instance from the internal app even if it looks like it's attempting to connect via port 1433.
    – MattyZDBA
    Nov 22, 2013 at 15:56
  • 1
    @MZDBA: The Browser service resolves the instance name to a port number based on what's set in the Properties dialog. It will work regardless of whether it's using static or dynamic ports. The application can (still) either use the instance name or the port number to connect.
    – Jon Seigel
    Nov 22, 2013 at 19:15
  • +1 on what Jon said. I touched on that really quick in my answer but should have expanded beyond just saying they should be fine :-) Good catch.
    – Mike Walsh
    Nov 22, 2013 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.