How to Query Remote Linux/Rasbian System's Hostname












0














I have several Raspberry Pi deployments that I want to be able to remotely query over the network for their hostname.



I've found that if I enable SMB via Samba that I can successfully query with a NetBios lookup. For security reason I would assume not to introduce SMB on these system for the sole purpose of hostname identification.



It should also be noted that these systems are not part of a domain and do not register with DNS.



Is there any known methods out there that will allow me to query an IP address and return the hostname (as defined in /etc/hostname) of a linux based system?










share|improve this question






















  • Use ssh to the remote rpi and use a command to retrieve the hostname (hostname, uname -n ...). Secure by design, especially with a key. Or is there something preventing this that isn't in the question?
    – A.B
    Dec 11 '18 at 18:51












  • I have have about 50 devices connected through WiFi and will receive their IP from DHCP. The devices will move around often and assigning a static IP will get away from the zero touch setup we currently use. I want to be able to scan multiple subnet ranges to find the specific hostname I am looking for then SSH to it.
    – Brandon763
    Dec 11 '18 at 19:47












  • My alternative would be to document the MAC address for each device / hostname then search for the MAC when needed. It would be best if I would run a program like AngryIP Scanner each time I was looking for a device.
    – Brandon763
    Dec 11 '18 at 19:52










  • Can't you get the information from the DHCP server then? The device can send (or receive) its hostname to (from) it.
    – A.B
    Dec 11 '18 at 20:09






  • 1




    If you don't want to use the ssh protocol (which is already installed), you can install a snmp server. OID 1.3.6.1.2.1.1.5 should give the information. avahi/zeroconf mught be an other method which might allow broadcast or multicast. Whatever you do you have to install something to get the hostname. It won't come from a ping.
    – A.B
    Dec 12 '18 at 16:12


















0














I have several Raspberry Pi deployments that I want to be able to remotely query over the network for their hostname.



I've found that if I enable SMB via Samba that I can successfully query with a NetBios lookup. For security reason I would assume not to introduce SMB on these system for the sole purpose of hostname identification.



It should also be noted that these systems are not part of a domain and do not register with DNS.



Is there any known methods out there that will allow me to query an IP address and return the hostname (as defined in /etc/hostname) of a linux based system?










share|improve this question






















  • Use ssh to the remote rpi and use a command to retrieve the hostname (hostname, uname -n ...). Secure by design, especially with a key. Or is there something preventing this that isn't in the question?
    – A.B
    Dec 11 '18 at 18:51












  • I have have about 50 devices connected through WiFi and will receive their IP from DHCP. The devices will move around often and assigning a static IP will get away from the zero touch setup we currently use. I want to be able to scan multiple subnet ranges to find the specific hostname I am looking for then SSH to it.
    – Brandon763
    Dec 11 '18 at 19:47












  • My alternative would be to document the MAC address for each device / hostname then search for the MAC when needed. It would be best if I would run a program like AngryIP Scanner each time I was looking for a device.
    – Brandon763
    Dec 11 '18 at 19:52










  • Can't you get the information from the DHCP server then? The device can send (or receive) its hostname to (from) it.
    – A.B
    Dec 11 '18 at 20:09






  • 1




    If you don't want to use the ssh protocol (which is already installed), you can install a snmp server. OID 1.3.6.1.2.1.1.5 should give the information. avahi/zeroconf mught be an other method which might allow broadcast or multicast. Whatever you do you have to install something to get the hostname. It won't come from a ping.
    – A.B
    Dec 12 '18 at 16:12
















0












0








0







I have several Raspberry Pi deployments that I want to be able to remotely query over the network for their hostname.



I've found that if I enable SMB via Samba that I can successfully query with a NetBios lookup. For security reason I would assume not to introduce SMB on these system for the sole purpose of hostname identification.



It should also be noted that these systems are not part of a domain and do not register with DNS.



Is there any known methods out there that will allow me to query an IP address and return the hostname (as defined in /etc/hostname) of a linux based system?










share|improve this question













I have several Raspberry Pi deployments that I want to be able to remotely query over the network for their hostname.



I've found that if I enable SMB via Samba that I can successfully query with a NetBios lookup. For security reason I would assume not to introduce SMB on these system for the sole purpose of hostname identification.



It should also be noted that these systems are not part of a domain and do not register with DNS.



Is there any known methods out there that will allow me to query an IP address and return the hostname (as defined in /etc/hostname) of a linux based system?







linux hostname






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 11 '18 at 14:05









Brandon763

11




11












  • Use ssh to the remote rpi and use a command to retrieve the hostname (hostname, uname -n ...). Secure by design, especially with a key. Or is there something preventing this that isn't in the question?
    – A.B
    Dec 11 '18 at 18:51












  • I have have about 50 devices connected through WiFi and will receive their IP from DHCP. The devices will move around often and assigning a static IP will get away from the zero touch setup we currently use. I want to be able to scan multiple subnet ranges to find the specific hostname I am looking for then SSH to it.
    – Brandon763
    Dec 11 '18 at 19:47












  • My alternative would be to document the MAC address for each device / hostname then search for the MAC when needed. It would be best if I would run a program like AngryIP Scanner each time I was looking for a device.
    – Brandon763
    Dec 11 '18 at 19:52










  • Can't you get the information from the DHCP server then? The device can send (or receive) its hostname to (from) it.
    – A.B
    Dec 11 '18 at 20:09






  • 1




    If you don't want to use the ssh protocol (which is already installed), you can install a snmp server. OID 1.3.6.1.2.1.1.5 should give the information. avahi/zeroconf mught be an other method which might allow broadcast or multicast. Whatever you do you have to install something to get the hostname. It won't come from a ping.
    – A.B
    Dec 12 '18 at 16:12




















  • Use ssh to the remote rpi and use a command to retrieve the hostname (hostname, uname -n ...). Secure by design, especially with a key. Or is there something preventing this that isn't in the question?
    – A.B
    Dec 11 '18 at 18:51












  • I have have about 50 devices connected through WiFi and will receive their IP from DHCP. The devices will move around often and assigning a static IP will get away from the zero touch setup we currently use. I want to be able to scan multiple subnet ranges to find the specific hostname I am looking for then SSH to it.
    – Brandon763
    Dec 11 '18 at 19:47












  • My alternative would be to document the MAC address for each device / hostname then search for the MAC when needed. It would be best if I would run a program like AngryIP Scanner each time I was looking for a device.
    – Brandon763
    Dec 11 '18 at 19:52










  • Can't you get the information from the DHCP server then? The device can send (or receive) its hostname to (from) it.
    – A.B
    Dec 11 '18 at 20:09






  • 1




    If you don't want to use the ssh protocol (which is already installed), you can install a snmp server. OID 1.3.6.1.2.1.1.5 should give the information. avahi/zeroconf mught be an other method which might allow broadcast or multicast. Whatever you do you have to install something to get the hostname. It won't come from a ping.
    – A.B
    Dec 12 '18 at 16:12


















Use ssh to the remote rpi and use a command to retrieve the hostname (hostname, uname -n ...). Secure by design, especially with a key. Or is there something preventing this that isn't in the question?
– A.B
Dec 11 '18 at 18:51






Use ssh to the remote rpi and use a command to retrieve the hostname (hostname, uname -n ...). Secure by design, especially with a key. Or is there something preventing this that isn't in the question?
– A.B
Dec 11 '18 at 18:51














I have have about 50 devices connected through WiFi and will receive their IP from DHCP. The devices will move around often and assigning a static IP will get away from the zero touch setup we currently use. I want to be able to scan multiple subnet ranges to find the specific hostname I am looking for then SSH to it.
– Brandon763
Dec 11 '18 at 19:47






I have have about 50 devices connected through WiFi and will receive their IP from DHCP. The devices will move around often and assigning a static IP will get away from the zero touch setup we currently use. I want to be able to scan multiple subnet ranges to find the specific hostname I am looking for then SSH to it.
– Brandon763
Dec 11 '18 at 19:47














My alternative would be to document the MAC address for each device / hostname then search for the MAC when needed. It would be best if I would run a program like AngryIP Scanner each time I was looking for a device.
– Brandon763
Dec 11 '18 at 19:52




My alternative would be to document the MAC address for each device / hostname then search for the MAC when needed. It would be best if I would run a program like AngryIP Scanner each time I was looking for a device.
– Brandon763
Dec 11 '18 at 19:52












Can't you get the information from the DHCP server then? The device can send (or receive) its hostname to (from) it.
– A.B
Dec 11 '18 at 20:09




Can't you get the information from the DHCP server then? The device can send (or receive) its hostname to (from) it.
– A.B
Dec 11 '18 at 20:09




1




1




If you don't want to use the ssh protocol (which is already installed), you can install a snmp server. OID 1.3.6.1.2.1.1.5 should give the information. avahi/zeroconf mught be an other method which might allow broadcast or multicast. Whatever you do you have to install something to get the hostname. It won't come from a ping.
– A.B
Dec 12 '18 at 16:12






If you don't want to use the ssh protocol (which is already installed), you can install a snmp server. OID 1.3.6.1.2.1.1.5 should give the information. avahi/zeroconf mught be an other method which might allow broadcast or multicast. Whatever you do you have to install something to get the hostname. It won't come from a ping.
– A.B
Dec 12 '18 at 16:12












1 Answer
1






active

oldest

votes


















0














I explored the SNMP route and it looks like that is as good as it will get. I created a bat file that did SNMPGETs on 254 addresses then parsed the results. I used SNMP Softwares tool (snmpsoft.com/shell-tools/snmp-get) to accomplish this in Windows. The min timeout value is 1 second so it takes a couple of mins to run but not an issue, wouldn't want it much lower.
Thanks AB.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1382638%2fhow-to-query-remote-linux-rasbian-systems-hostname%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I explored the SNMP route and it looks like that is as good as it will get. I created a bat file that did SNMPGETs on 254 addresses then parsed the results. I used SNMP Softwares tool (snmpsoft.com/shell-tools/snmp-get) to accomplish this in Windows. The min timeout value is 1 second so it takes a couple of mins to run but not an issue, wouldn't want it much lower.
    Thanks AB.






    share|improve this answer


























      0














      I explored the SNMP route and it looks like that is as good as it will get. I created a bat file that did SNMPGETs on 254 addresses then parsed the results. I used SNMP Softwares tool (snmpsoft.com/shell-tools/snmp-get) to accomplish this in Windows. The min timeout value is 1 second so it takes a couple of mins to run but not an issue, wouldn't want it much lower.
      Thanks AB.






      share|improve this answer
























        0












        0








        0






        I explored the SNMP route and it looks like that is as good as it will get. I created a bat file that did SNMPGETs on 254 addresses then parsed the results. I used SNMP Softwares tool (snmpsoft.com/shell-tools/snmp-get) to accomplish this in Windows. The min timeout value is 1 second so it takes a couple of mins to run but not an issue, wouldn't want it much lower.
        Thanks AB.






        share|improve this answer












        I explored the SNMP route and it looks like that is as good as it will get. I created a bat file that did SNMPGETs on 254 addresses then parsed the results. I used SNMP Softwares tool (snmpsoft.com/shell-tools/snmp-get) to accomplish this in Windows. The min timeout value is 1 second so it takes a couple of mins to run but not an issue, wouldn't want it much lower.
        Thanks AB.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 13 '18 at 15:09









        Brandon763

        11




        11






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1382638%2fhow-to-query-remote-linux-rasbian-systems-hostname%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Plaza Victoria

            Brian Clough

            Cáceres