{
    "mode": "perldoc",
    "parameter": "Sys::Hostname::Long",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Sys%3A%3AHostname%3A%3ALong/json",
    "generated": "2026-06-11T23:52:38Z",
    "synopsis": "use Sys::Hostname::Long;\n$hostlong = hostnamelong;",
    "sections": {
        "NAME": {
            "content": "Sys::Hostname::Long - Try every conceivable way to get full hostname\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Sys::Hostname::Long;\n$hostlong = hostnamelong;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "How to get the host full name in perl on multiple operating systems (mac, windows, unix* etc)\n",
            "subsections": []
        },
        "DISCUSSION": {
            "content": "This is the SECOND release of this code. It has an improved set of tests and improved interfaces\n- but it is still often failing to get a full host name. This of course is the reason I wrote\nthe module, it is difficult to get full host names accurately on each system. On some systems\n(eg: Linux) it is dependent on the order of the entries in /etc/hosts.\n\nTo make it easier to test I have testall.pl to generate an output list of all methods. Thus even\nif the logic is incorrect, it may be possible to get the full name.\n\nAttempt via many methods to get the systems full name. The Sys::Hostname class is the best and\nstandard way to get the system hostname. However it is missing the long hostname.\n\nSpecial thanks to David Sundstrom and Greg Bacon for the original Sys::Hostname\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "This is the original list of platforms tested.\n\nMacOS           Macintosh Classic               OK\nWin32           MS Windows (95,98,nt,2000...)\n98                              OK\nMacOS X         Macintosh 10                    OK\n(other darwin)                  Probably OK (not tested)\nLinux           Linux UNIX OS                   OK\nSparc                           OK\nHPUX            H.P. Unix 10?                   Not Tested\nSolaris         SUN Solaris 7?                  OK (now)\nIrix            SGI Irix 5?                     Not Tested\nFreeBSD         FreeBSD                         OK\n\nA new list has now been compiled of all the operating systems so that I can individually keep\ninformation on their success.\n\nTHIS IS IN NEED OF AN UPDATE AFTER NEXT RELEASE.\n\nAcorn - Not yet tested\nAIX - Not yet tested\nAmiga - Not yet tested\nAtari - Not yet tested\nAtheOS - Not yet tested\nBeOS - Not yet tested\nBSD - Not yet tested\nBSD/OS - Not yet tested\nCompaq - Not yet tested\nCygwin - Not yet tested\nConcurrent - Not yet tested\nDG/UX - Not yet tested\nDigital - Not yet tested\nDEC OSF/1 - Not yet tested\nDigital UNIX - Not yet tested\nDYNIX/ptx - Not yet tested\nEPOC - Not yet tested\nFreeBSD - Not yet tested\nFujitsu-Siemens - Not yet tested\nGuardian - Not yet tested\nHP - Not yet tested\nHP-UX - Not yet tested\nIBM - Not yet tested\nIRIX - Not yet tested - 3rd hand information might be ok.\nJapanese - Not yet tested\nJPerl - Not yet tested\nLinux\n\nDebian - Not yet tested\nGentoo - Not yet tested\nMandrake - Not yet tested\nRed Hat- Not yet tested\nSlackware - Not yet tested\nSuSe - Not yet tested\nYellowdog - Not yet tested\n\nLynxOS - Not yet tested\nMac OS - Not yet tested\nMac OS X - OK 20040315 (v1.1)\nMachTen - Not yet tested\nMinix - Not yet tested\nMinGW - Not yet tested\nMiNT - Not yet tested\nMPE/iX - Not yet tested\nMS-DOS - Not yet tested\nMVS - Not yet tested\nNetBSD - Not yet tested\nNetWare - Not yet tested\nNEWS-OS - Not yet tested\nNextStep - Not yet tested\nNovell - Not yet tested\nNonStop - Not yet tested\nNonStop-UX - Not yet tested\nOpenBSD - Not yet tested\nODT - Not yet tested\nOpenVMS - Not yet tested\nOpen UNIX - Not yet tested\nOS/2 - Not yet tested\nOS/390 - Not yet tested\nOS/400 - Not yet tested\nOSF/1 - Not yet tested\nOSR - Not yet tested\nPlan 9 - Not yet tested\nPocket PC - Not yet tested\nPowerMAX - Not yet tested\nPsion - Not yet tested\nQNX\n\n4 - Not yet tested\n6 (Neutrino) - Not yet tested\n\nReliant UNIX - Not yet tested\nRISCOS - Not yet tested\nSCO - Not yet tested\nSGI - Not yet tested\nSymbian - Not yet tested\nSequent - Not yet tested\nSiemens - Not yet tested\nSINIX - Not yet tested\nSolaris - Not yet tested\nSONY - Not yet tested\nSun - Not yet tested\nStratus - Not yet tested\nTandem - Not yet tested\nTru64 - Not yet tested\nUltrix - Not yet tested\nUNIX - Not yet tested\nU/WIN - Not yet tested\nUnixware - Not yet tested\nVMS - Not yet tested\nVOS - Not yet tested\nWindows\n\nCE - Not yet tested\n3.1 - Not yet tested\n95 - Not yet tested\n98 - Not yet tested\nMe - Not yet tested\nNT - Not yet tested\n2000 - Not yet tested\nXP - Not yet tested\n\nz/OS - Not yet tested\n",
            "subsections": []
        },
        "KNOWN LIMITATIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "Unix",
                    "content": "Most unix systems have trouble working out the fully qualified domain name as it to be\nconfigured somewhere in the system correctly. For example in most linux systems (debian, ?) the\nfully qualified name should be the first entry next to the ip number in /etc/hosts\n\n192.168.0.1     fred.somwhere.special   fred\n\nIf it is the other way around, it will fail.\n"
                },
                {
                    "name": "Mac",
                    "content": ""
                }
            ]
        },
        "TODO": {
            "content": "Contributions\n\nDavid Dick\nGraeme Hart\nPiotr Klaban\n\n* Extra code from G\n* Dispatch table\n* List of all operating systems.\n\nSolaris * Fall back 2 - TCP with DNS works ok * Also can read /etc/defaultdomain file\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "L<Sys::Hostname>\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Originally by Scott Penrose <scottp@dd.com.au>\n\nContributions: Michiel Beijen <michiel.beijen@gmail.com>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (c) 2001,2004,2005,2015 Scott Penrose. All rights reserved. This program is free\nsoftware; you can redistribute it and/or modify it under the same terms as Perl itself.\n",
            "subsections": []
        }
    },
    "summary": "Sys::Hostname::Long - Try every conceivable way to get full hostname",
    "flags": [],
    "examples": [],
    "see_also": []
}