ARP hostnames problem

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am having problem with viewing hostnames of devices located in my LAN.
On my first laptop (Ubuntu 18.04 LTS Desktop edition) result of following command:



arp -a


Is exactly what I want:



X (192.168.56.243) at 40:a3:cc:99:2d:66 [ether] on wlan0
test-test-test (192.168.56.146) at 48:bf:6b:e3:bf:5a [ether] on wlan0
TP-Link_Archer_ (192.168.56.1) at 10:7b:44:40:61:70 [ether] on wlan0


Using nmap, I am able to scan my LAN using this command:



nmap -sn 192.168.56.0/24


And I get the perfect results with hostnames:



Starting Nmap 7.60 ( https://nmap.org ) at 2018-08-07 09:07 EDT
Nmap scan report for TP-Link_Archer_ (192.168.56.1)
Host is up (0.0054s latency).
Nmap scan report for ZZ (192.168.56.156)
Host is up (0.00045s latency).


However, on another laptop with Debian 9 x64 Minimal installed, the whole hostnames part is missing.
Whenever I issue arp -a, I get the following:



? (192.168.56.243) at 40:a3:cc:99:2d:66 [ether] on wlan0
? (192.168.56.146) at 48:bf:6b:e3:bf:5a [ether] on wlan0
? (192.168.56.1) at 10:7b:44:40:61:70 [ether] on wlan0


Moreover, scanning with nmap -sn 192.168.56.0/24 produces this output:



Starting Nmap 7.60 ( https://nmap.org ) at 2018-08-07 09:17 EDT
Nmap scan report for 192.168.56.1
Host is up (0.0054s latency).
Nmap scan report for 192.168.56.156
Host is up (0.00045s latency).


I have honestly no idea what is going on, most likely I am missing something in Debian Minimal installation, which is installed in Ubuntu. But I have no clue where to find the missing part so Debian machine can start showing me hostnames.



Any ideas?



EDIT:
My /etc/nsswitch.conf is exactly this:



root@zxcv:/home/test# cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: compat
group: compat
shadow: compat
gshadow: files

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis


However I've setup a VM with bridged network adapter, installed same version of Debian Minimal, and I am able to get the hostnames for all IPs.
The question now is, which packets/modules/services is the failing Debian missing, which prevents from getting hostnames?










share|improve this question



















  • 1




    Is reverse name resolution working correctly on the Debian laptop? It needs it to convert IP addresses (gleaned from the ARP cache) to host-names.
    – garethTheRed
    Aug 7 at 13:40











  • @garethTheRed How can I check if it is working correctly? So far host 192.168.561 on debian gives me Host 1.0.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
    – RedS
    Aug 7 at 13:51















up vote
1
down vote

favorite












I am having problem with viewing hostnames of devices located in my LAN.
On my first laptop (Ubuntu 18.04 LTS Desktop edition) result of following command:



arp -a


Is exactly what I want:



X (192.168.56.243) at 40:a3:cc:99:2d:66 [ether] on wlan0
test-test-test (192.168.56.146) at 48:bf:6b:e3:bf:5a [ether] on wlan0
TP-Link_Archer_ (192.168.56.1) at 10:7b:44:40:61:70 [ether] on wlan0


Using nmap, I am able to scan my LAN using this command:



nmap -sn 192.168.56.0/24


And I get the perfect results with hostnames:



Starting Nmap 7.60 ( https://nmap.org ) at 2018-08-07 09:07 EDT
Nmap scan report for TP-Link_Archer_ (192.168.56.1)
Host is up (0.0054s latency).
Nmap scan report for ZZ (192.168.56.156)
Host is up (0.00045s latency).


However, on another laptop with Debian 9 x64 Minimal installed, the whole hostnames part is missing.
Whenever I issue arp -a, I get the following:



? (192.168.56.243) at 40:a3:cc:99:2d:66 [ether] on wlan0
? (192.168.56.146) at 48:bf:6b:e3:bf:5a [ether] on wlan0
? (192.168.56.1) at 10:7b:44:40:61:70 [ether] on wlan0


Moreover, scanning with nmap -sn 192.168.56.0/24 produces this output:



Starting Nmap 7.60 ( https://nmap.org ) at 2018-08-07 09:17 EDT
Nmap scan report for 192.168.56.1
Host is up (0.0054s latency).
Nmap scan report for 192.168.56.156
Host is up (0.00045s latency).


I have honestly no idea what is going on, most likely I am missing something in Debian Minimal installation, which is installed in Ubuntu. But I have no clue where to find the missing part so Debian machine can start showing me hostnames.



Any ideas?



EDIT:
My /etc/nsswitch.conf is exactly this:



root@zxcv:/home/test# cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: compat
group: compat
shadow: compat
gshadow: files

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis


However I've setup a VM with bridged network adapter, installed same version of Debian Minimal, and I am able to get the hostnames for all IPs.
The question now is, which packets/modules/services is the failing Debian missing, which prevents from getting hostnames?










share|improve this question



















  • 1




    Is reverse name resolution working correctly on the Debian laptop? It needs it to convert IP addresses (gleaned from the ARP cache) to host-names.
    – garethTheRed
    Aug 7 at 13:40











  • @garethTheRed How can I check if it is working correctly? So far host 192.168.561 on debian gives me Host 1.0.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
    – RedS
    Aug 7 at 13:51













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am having problem with viewing hostnames of devices located in my LAN.
On my first laptop (Ubuntu 18.04 LTS Desktop edition) result of following command:



arp -a


Is exactly what I want:



X (192.168.56.243) at 40:a3:cc:99:2d:66 [ether] on wlan0
test-test-test (192.168.56.146) at 48:bf:6b:e3:bf:5a [ether] on wlan0
TP-Link_Archer_ (192.168.56.1) at 10:7b:44:40:61:70 [ether] on wlan0


Using nmap, I am able to scan my LAN using this command:



nmap -sn 192.168.56.0/24


And I get the perfect results with hostnames:



Starting Nmap 7.60 ( https://nmap.org ) at 2018-08-07 09:07 EDT
Nmap scan report for TP-Link_Archer_ (192.168.56.1)
Host is up (0.0054s latency).
Nmap scan report for ZZ (192.168.56.156)
Host is up (0.00045s latency).


However, on another laptop with Debian 9 x64 Minimal installed, the whole hostnames part is missing.
Whenever I issue arp -a, I get the following:



? (192.168.56.243) at 40:a3:cc:99:2d:66 [ether] on wlan0
? (192.168.56.146) at 48:bf:6b:e3:bf:5a [ether] on wlan0
? (192.168.56.1) at 10:7b:44:40:61:70 [ether] on wlan0


Moreover, scanning with nmap -sn 192.168.56.0/24 produces this output:



Starting Nmap 7.60 ( https://nmap.org ) at 2018-08-07 09:17 EDT
Nmap scan report for 192.168.56.1
Host is up (0.0054s latency).
Nmap scan report for 192.168.56.156
Host is up (0.00045s latency).


I have honestly no idea what is going on, most likely I am missing something in Debian Minimal installation, which is installed in Ubuntu. But I have no clue where to find the missing part so Debian machine can start showing me hostnames.



Any ideas?



EDIT:
My /etc/nsswitch.conf is exactly this:



root@zxcv:/home/test# cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: compat
group: compat
shadow: compat
gshadow: files

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis


However I've setup a VM with bridged network adapter, installed same version of Debian Minimal, and I am able to get the hostnames for all IPs.
The question now is, which packets/modules/services is the failing Debian missing, which prevents from getting hostnames?










share|improve this question















I am having problem with viewing hostnames of devices located in my LAN.
On my first laptop (Ubuntu 18.04 LTS Desktop edition) result of following command:



arp -a


Is exactly what I want:



X (192.168.56.243) at 40:a3:cc:99:2d:66 [ether] on wlan0
test-test-test (192.168.56.146) at 48:bf:6b:e3:bf:5a [ether] on wlan0
TP-Link_Archer_ (192.168.56.1) at 10:7b:44:40:61:70 [ether] on wlan0


Using nmap, I am able to scan my LAN using this command:



nmap -sn 192.168.56.0/24


And I get the perfect results with hostnames:



Starting Nmap 7.60 ( https://nmap.org ) at 2018-08-07 09:07 EDT
Nmap scan report for TP-Link_Archer_ (192.168.56.1)
Host is up (0.0054s latency).
Nmap scan report for ZZ (192.168.56.156)
Host is up (0.00045s latency).


However, on another laptop with Debian 9 x64 Minimal installed, the whole hostnames part is missing.
Whenever I issue arp -a, I get the following:



? (192.168.56.243) at 40:a3:cc:99:2d:66 [ether] on wlan0
? (192.168.56.146) at 48:bf:6b:e3:bf:5a [ether] on wlan0
? (192.168.56.1) at 10:7b:44:40:61:70 [ether] on wlan0


Moreover, scanning with nmap -sn 192.168.56.0/24 produces this output:



Starting Nmap 7.60 ( https://nmap.org ) at 2018-08-07 09:17 EDT
Nmap scan report for 192.168.56.1
Host is up (0.0054s latency).
Nmap scan report for 192.168.56.156
Host is up (0.00045s latency).


I have honestly no idea what is going on, most likely I am missing something in Debian Minimal installation, which is installed in Ubuntu. But I have no clue where to find the missing part so Debian machine can start showing me hostnames.



Any ideas?



EDIT:
My /etc/nsswitch.conf is exactly this:



root@zxcv:/home/test# cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: compat
group: compat
shadow: compat
gshadow: files

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis


However I've setup a VM with bridged network adapter, installed same version of Debian Minimal, and I am able to get the hostnames for all IPs.
The question now is, which packets/modules/services is the failing Debian missing, which prevents from getting hostnames?







linux debian networking nmap arp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 7 at 15:04

























asked Aug 7 at 13:13









RedS

83




83







  • 1




    Is reverse name resolution working correctly on the Debian laptop? It needs it to convert IP addresses (gleaned from the ARP cache) to host-names.
    – garethTheRed
    Aug 7 at 13:40











  • @garethTheRed How can I check if it is working correctly? So far host 192.168.561 on debian gives me Host 1.0.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
    – RedS
    Aug 7 at 13:51













  • 1




    Is reverse name resolution working correctly on the Debian laptop? It needs it to convert IP addresses (gleaned from the ARP cache) to host-names.
    – garethTheRed
    Aug 7 at 13:40











  • @garethTheRed How can I check if it is working correctly? So far host 192.168.561 on debian gives me Host 1.0.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
    – RedS
    Aug 7 at 13:51








1




1




Is reverse name resolution working correctly on the Debian laptop? It needs it to convert IP addresses (gleaned from the ARP cache) to host-names.
– garethTheRed
Aug 7 at 13:40





Is reverse name resolution working correctly on the Debian laptop? It needs it to convert IP addresses (gleaned from the ARP cache) to host-names.
– garethTheRed
Aug 7 at 13:40













@garethTheRed How can I check if it is working correctly? So far host 192.168.561 on debian gives me Host 1.0.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
– RedS
Aug 7 at 13:51





@garethTheRed How can I check if it is working correctly? So far host 192.168.561 on debian gives me Host 1.0.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
– RedS
Aug 7 at 13:51











2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










You don't have access to the DNS server that can translate IP addresses to names.



There are other ways to associate host names and IP addresses, but if you have more than one computer, DNS is your best answer.



And in reply to your comment, yes, /etc/resolv.conf should contain the address of the DNS server. In a small network this is often the same as the router.






share|improve this answer



























    up vote
    1
    down vote













    arp is interrogating your system to determine how it can translate IP's to hostnames. If you use the -n switch it'll forgo this and simply show the IPs without any translation to hostnames.



    Like most tools in Linux, arp uses NS (Name Service Switch) to do the lookups. If you strace your arp command you can see it looking these things up:



    $ strace -s 2000 arp -a
    ...
    open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 5


    After looking in this file arp will discover how it's suppose to look up hostnames.



    $ grep hosts: /etc/nsswitch.conf
    #hosts: db files nisplus nis dns
    hosts: files dns myhostname


    This says to look in files 1st, then inquire to DNS 2nd... The word files here means to use the system's /etc/hosts file. You can tap into how NS would do this by using the getent hosts command.



    Example



    On my VM of CentOS 7 for example:



    $ arp -a
    ? (10.0.2.3) at 52:54:00:12:35:03 [ether] on eth0
    gateway (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0
    $ arp -an
    ? (10.0.2.3) at 52:54:00:12:35:03 [ether] on eth0
    ? (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0


    If we inquire to getent looking for the 10.0.2.2 IP:



    $ getent hosts 10.0.2.2
    10.0.2.2 gateway


    The IPs, if not present locally in any files, will be looked up in DNS next. Since my IPs are all private IPs to this VM, and they're not explicitly in my VM's defined DNS, which is incidentally defined here:



    $ more /etc/resolv.conf
    # Generated by NetworkManager
    nameserver 10.0.2.3


    NOTE: arp is left with no other choice than to show you a question mark, because it failed to find any name to use.






    share|improve this answer




















    • If my /etc/resolv.conf doesnt contain router's IP address (which acts as DNS server), could it be the cause of problems?
      – RedS
      Aug 7 at 16:21










    • @RedS - that would be the next thing I'd try as well.
      – slm♦
      Aug 7 at 16:54










    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461070%2farp-hostnames-problem%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    You don't have access to the DNS server that can translate IP addresses to names.



    There are other ways to associate host names and IP addresses, but if you have more than one computer, DNS is your best answer.



    And in reply to your comment, yes, /etc/resolv.conf should contain the address of the DNS server. In a small network this is often the same as the router.






    share|improve this answer
























      up vote
      0
      down vote



      accepted










      You don't have access to the DNS server that can translate IP addresses to names.



      There are other ways to associate host names and IP addresses, but if you have more than one computer, DNS is your best answer.



      And in reply to your comment, yes, /etc/resolv.conf should contain the address of the DNS server. In a small network this is often the same as the router.






      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        You don't have access to the DNS server that can translate IP addresses to names.



        There are other ways to associate host names and IP addresses, but if you have more than one computer, DNS is your best answer.



        And in reply to your comment, yes, /etc/resolv.conf should contain the address of the DNS server. In a small network this is often the same as the router.






        share|improve this answer












        You don't have access to the DNS server that can translate IP addresses to names.



        There are other ways to associate host names and IP addresses, but if you have more than one computer, DNS is your best answer.



        And in reply to your comment, yes, /etc/resolv.conf should contain the address of the DNS server. In a small network this is often the same as the router.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 7 at 17:37









        RalfFriedl

        3,5601522




        3,5601522






















            up vote
            1
            down vote













            arp is interrogating your system to determine how it can translate IP's to hostnames. If you use the -n switch it'll forgo this and simply show the IPs without any translation to hostnames.



            Like most tools in Linux, arp uses NS (Name Service Switch) to do the lookups. If you strace your arp command you can see it looking these things up:



            $ strace -s 2000 arp -a
            ...
            open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 5


            After looking in this file arp will discover how it's suppose to look up hostnames.



            $ grep hosts: /etc/nsswitch.conf
            #hosts: db files nisplus nis dns
            hosts: files dns myhostname


            This says to look in files 1st, then inquire to DNS 2nd... The word files here means to use the system's /etc/hosts file. You can tap into how NS would do this by using the getent hosts command.



            Example



            On my VM of CentOS 7 for example:



            $ arp -a
            ? (10.0.2.3) at 52:54:00:12:35:03 [ether] on eth0
            gateway (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0
            $ arp -an
            ? (10.0.2.3) at 52:54:00:12:35:03 [ether] on eth0
            ? (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0


            If we inquire to getent looking for the 10.0.2.2 IP:



            $ getent hosts 10.0.2.2
            10.0.2.2 gateway


            The IPs, if not present locally in any files, will be looked up in DNS next. Since my IPs are all private IPs to this VM, and they're not explicitly in my VM's defined DNS, which is incidentally defined here:



            $ more /etc/resolv.conf
            # Generated by NetworkManager
            nameserver 10.0.2.3


            NOTE: arp is left with no other choice than to show you a question mark, because it failed to find any name to use.






            share|improve this answer




















            • If my /etc/resolv.conf doesnt contain router's IP address (which acts as DNS server), could it be the cause of problems?
              – RedS
              Aug 7 at 16:21










            • @RedS - that would be the next thing I'd try as well.
              – slm♦
              Aug 7 at 16:54














            up vote
            1
            down vote













            arp is interrogating your system to determine how it can translate IP's to hostnames. If you use the -n switch it'll forgo this and simply show the IPs without any translation to hostnames.



            Like most tools in Linux, arp uses NS (Name Service Switch) to do the lookups. If you strace your arp command you can see it looking these things up:



            $ strace -s 2000 arp -a
            ...
            open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 5


            After looking in this file arp will discover how it's suppose to look up hostnames.



            $ grep hosts: /etc/nsswitch.conf
            #hosts: db files nisplus nis dns
            hosts: files dns myhostname


            This says to look in files 1st, then inquire to DNS 2nd... The word files here means to use the system's /etc/hosts file. You can tap into how NS would do this by using the getent hosts command.



            Example



            On my VM of CentOS 7 for example:



            $ arp -a
            ? (10.0.2.3) at 52:54:00:12:35:03 [ether] on eth0
            gateway (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0
            $ arp -an
            ? (10.0.2.3) at 52:54:00:12:35:03 [ether] on eth0
            ? (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0


            If we inquire to getent looking for the 10.0.2.2 IP:



            $ getent hosts 10.0.2.2
            10.0.2.2 gateway


            The IPs, if not present locally in any files, will be looked up in DNS next. Since my IPs are all private IPs to this VM, and they're not explicitly in my VM's defined DNS, which is incidentally defined here:



            $ more /etc/resolv.conf
            # Generated by NetworkManager
            nameserver 10.0.2.3


            NOTE: arp is left with no other choice than to show you a question mark, because it failed to find any name to use.






            share|improve this answer




















            • If my /etc/resolv.conf doesnt contain router's IP address (which acts as DNS server), could it be the cause of problems?
              – RedS
              Aug 7 at 16:21










            • @RedS - that would be the next thing I'd try as well.
              – slm♦
              Aug 7 at 16:54












            up vote
            1
            down vote










            up vote
            1
            down vote









            arp is interrogating your system to determine how it can translate IP's to hostnames. If you use the -n switch it'll forgo this and simply show the IPs without any translation to hostnames.



            Like most tools in Linux, arp uses NS (Name Service Switch) to do the lookups. If you strace your arp command you can see it looking these things up:



            $ strace -s 2000 arp -a
            ...
            open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 5


            After looking in this file arp will discover how it's suppose to look up hostnames.



            $ grep hosts: /etc/nsswitch.conf
            #hosts: db files nisplus nis dns
            hosts: files dns myhostname


            This says to look in files 1st, then inquire to DNS 2nd... The word files here means to use the system's /etc/hosts file. You can tap into how NS would do this by using the getent hosts command.



            Example



            On my VM of CentOS 7 for example:



            $ arp -a
            ? (10.0.2.3) at 52:54:00:12:35:03 [ether] on eth0
            gateway (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0
            $ arp -an
            ? (10.0.2.3) at 52:54:00:12:35:03 [ether] on eth0
            ? (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0


            If we inquire to getent looking for the 10.0.2.2 IP:



            $ getent hosts 10.0.2.2
            10.0.2.2 gateway


            The IPs, if not present locally in any files, will be looked up in DNS next. Since my IPs are all private IPs to this VM, and they're not explicitly in my VM's defined DNS, which is incidentally defined here:



            $ more /etc/resolv.conf
            # Generated by NetworkManager
            nameserver 10.0.2.3


            NOTE: arp is left with no other choice than to show you a question mark, because it failed to find any name to use.






            share|improve this answer












            arp is interrogating your system to determine how it can translate IP's to hostnames. If you use the -n switch it'll forgo this and simply show the IPs without any translation to hostnames.



            Like most tools in Linux, arp uses NS (Name Service Switch) to do the lookups. If you strace your arp command you can see it looking these things up:



            $ strace -s 2000 arp -a
            ...
            open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 5


            After looking in this file arp will discover how it's suppose to look up hostnames.



            $ grep hosts: /etc/nsswitch.conf
            #hosts: db files nisplus nis dns
            hosts: files dns myhostname


            This says to look in files 1st, then inquire to DNS 2nd... The word files here means to use the system's /etc/hosts file. You can tap into how NS would do this by using the getent hosts command.



            Example



            On my VM of CentOS 7 for example:



            $ arp -a
            ? (10.0.2.3) at 52:54:00:12:35:03 [ether] on eth0
            gateway (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0
            $ arp -an
            ? (10.0.2.3) at 52:54:00:12:35:03 [ether] on eth0
            ? (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0


            If we inquire to getent looking for the 10.0.2.2 IP:



            $ getent hosts 10.0.2.2
            10.0.2.2 gateway


            The IPs, if not present locally in any files, will be looked up in DNS next. Since my IPs are all private IPs to this VM, and they're not explicitly in my VM's defined DNS, which is incidentally defined here:



            $ more /etc/resolv.conf
            # Generated by NetworkManager
            nameserver 10.0.2.3


            NOTE: arp is left with no other choice than to show you a question mark, because it failed to find any name to use.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 7 at 13:47









            slm♦

            238k65491662




            238k65491662











            • If my /etc/resolv.conf doesnt contain router's IP address (which acts as DNS server), could it be the cause of problems?
              – RedS
              Aug 7 at 16:21










            • @RedS - that would be the next thing I'd try as well.
              – slm♦
              Aug 7 at 16:54
















            • If my /etc/resolv.conf doesnt contain router's IP address (which acts as DNS server), could it be the cause of problems?
              – RedS
              Aug 7 at 16:21










            • @RedS - that would be the next thing I'd try as well.
              – slm♦
              Aug 7 at 16:54















            If my /etc/resolv.conf doesnt contain router's IP address (which acts as DNS server), could it be the cause of problems?
            – RedS
            Aug 7 at 16:21




            If my /etc/resolv.conf doesnt contain router's IP address (which acts as DNS server), could it be the cause of problems?
            – RedS
            Aug 7 at 16:21












            @RedS - that would be the next thing I'd try as well.
            – slm♦
            Aug 7 at 16:54




            @RedS - that would be the next thing I'd try as well.
            – slm♦
            Aug 7 at 16:54

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461070%2farp-hostnames-problem%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?