Manual talk:$wgServerName

If you need the servername in code, use:

$serverName = parse_url( $wgServer, PHP_URL_HOST ); // calculate, e.g., xyz.edu from $wgServer = http://xyz.edu