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.