Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by Dario Eberhard for Get the default server in php

The "Default Server" is your primary DNS server. Getting the default DNS server directly with PHP is not possible. From your further infos after Quentin asked, you dont look for the DNS Name. If it is a Server where you logon with f.ex. Windows, this could be the right answer:

echo getenv("LOGONSERVER");

Otherwise your solution with exec and parsing the output will be the best. Maybe you could use ipconfig /all for that and look for the DNS or DHCP server, depends on your environment.


Viewing all articles
Browse latest Browse all 2

Trending Articles