Ubuntu is trying to resolve local IP addresses












2















I run into a big problem on my project yesterday.
I have a local server which I connect to through websockets. Everything works fine.



The next step of the project was to use it when the network wasn't connected to internet. I thought it would go smoothly. Wrong! The websockets wouldn't connect.



After many hours, I found out that the local server would basically send a frame to try to resolve the local IP of the connecting client, and would lock the connection until it gets a reply, which my router couldn't answer as internet was unplugged.



The bad workaround I found was to add my client IP in the /etc/hosts/
But I cannot add all local addresses to the 'hosts' file.



Any idea how to prevent ubuntu to resolve local IPs? it configured as DHCP:



$>more /etc/network/interfaces



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto em1
iface em1 inet dhcp


Thanks a lot in advance










share|improve this question























  • So, you have a client and server, that are connected locally? While you're connected to the internet everything works, however when the internet is disconnected, you can't connect to the server? Your client is getting a public IP address for the server and not the local, so when the public is down it can't route? I'm not sure I completely follow.

    – bc2946088
    May 12 '16 at 13:11











  • So, both client and server are on the same local network. client has IP 192.168.1.121 and server has IP 192.168.1.124 What is troubling is that when I connect to the server (by SSH for example), the server is trying to resolve the 'hostname' 192.168.1.121.... It doesn't make much sense to me.... So when I unplugged the internet cab;e from the router, it takes 8 or 10 seconds to NOT resolve it, thus 'blocking' the connection process for as many seconds. For SSH it is fine, but the websockets I am using time out on connection

    – Fab Ien Millerand
    May 12 '16 at 13:46











  • Is your 'hostname' including the domain name, with a tld? Like hostname.domain.com ?

    – bc2946088
    May 12 '16 at 18:45













  • No. Each 'hostname' is one word. And all the communication is made with IP addresses and no hostname or domain name

    – Fab Ien Millerand
    May 13 '16 at 6:53
















2















I run into a big problem on my project yesterday.
I have a local server which I connect to through websockets. Everything works fine.



The next step of the project was to use it when the network wasn't connected to internet. I thought it would go smoothly. Wrong! The websockets wouldn't connect.



After many hours, I found out that the local server would basically send a frame to try to resolve the local IP of the connecting client, and would lock the connection until it gets a reply, which my router couldn't answer as internet was unplugged.



The bad workaround I found was to add my client IP in the /etc/hosts/
But I cannot add all local addresses to the 'hosts' file.



Any idea how to prevent ubuntu to resolve local IPs? it configured as DHCP:



$>more /etc/network/interfaces



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto em1
iface em1 inet dhcp


Thanks a lot in advance










share|improve this question























  • So, you have a client and server, that are connected locally? While you're connected to the internet everything works, however when the internet is disconnected, you can't connect to the server? Your client is getting a public IP address for the server and not the local, so when the public is down it can't route? I'm not sure I completely follow.

    – bc2946088
    May 12 '16 at 13:11











  • So, both client and server are on the same local network. client has IP 192.168.1.121 and server has IP 192.168.1.124 What is troubling is that when I connect to the server (by SSH for example), the server is trying to resolve the 'hostname' 192.168.1.121.... It doesn't make much sense to me.... So when I unplugged the internet cab;e from the router, it takes 8 or 10 seconds to NOT resolve it, thus 'blocking' the connection process for as many seconds. For SSH it is fine, but the websockets I am using time out on connection

    – Fab Ien Millerand
    May 12 '16 at 13:46











  • Is your 'hostname' including the domain name, with a tld? Like hostname.domain.com ?

    – bc2946088
    May 12 '16 at 18:45













  • No. Each 'hostname' is one word. And all the communication is made with IP addresses and no hostname or domain name

    – Fab Ien Millerand
    May 13 '16 at 6:53














2












2








2


2






I run into a big problem on my project yesterday.
I have a local server which I connect to through websockets. Everything works fine.



The next step of the project was to use it when the network wasn't connected to internet. I thought it would go smoothly. Wrong! The websockets wouldn't connect.



After many hours, I found out that the local server would basically send a frame to try to resolve the local IP of the connecting client, and would lock the connection until it gets a reply, which my router couldn't answer as internet was unplugged.



The bad workaround I found was to add my client IP in the /etc/hosts/
But I cannot add all local addresses to the 'hosts' file.



Any idea how to prevent ubuntu to resolve local IPs? it configured as DHCP:



$>more /etc/network/interfaces



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto em1
iface em1 inet dhcp


Thanks a lot in advance










share|improve this question














I run into a big problem on my project yesterday.
I have a local server which I connect to through websockets. Everything works fine.



The next step of the project was to use it when the network wasn't connected to internet. I thought it would go smoothly. Wrong! The websockets wouldn't connect.



After many hours, I found out that the local server would basically send a frame to try to resolve the local IP of the connecting client, and would lock the connection until it gets a reply, which my router couldn't answer as internet was unplugged.



The bad workaround I found was to add my client IP in the /etc/hosts/
But I cannot add all local addresses to the 'hosts' file.



Any idea how to prevent ubuntu to resolve local IPs? it configured as DHCP:



$>more /etc/network/interfaces



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto em1
iface em1 inet dhcp


Thanks a lot in advance







networking dns localhost






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 12 '16 at 12:12









Fab Ien MillerandFab Ien Millerand

111




111













  • So, you have a client and server, that are connected locally? While you're connected to the internet everything works, however when the internet is disconnected, you can't connect to the server? Your client is getting a public IP address for the server and not the local, so when the public is down it can't route? I'm not sure I completely follow.

    – bc2946088
    May 12 '16 at 13:11











  • So, both client and server are on the same local network. client has IP 192.168.1.121 and server has IP 192.168.1.124 What is troubling is that when I connect to the server (by SSH for example), the server is trying to resolve the 'hostname' 192.168.1.121.... It doesn't make much sense to me.... So when I unplugged the internet cab;e from the router, it takes 8 or 10 seconds to NOT resolve it, thus 'blocking' the connection process for as many seconds. For SSH it is fine, but the websockets I am using time out on connection

    – Fab Ien Millerand
    May 12 '16 at 13:46











  • Is your 'hostname' including the domain name, with a tld? Like hostname.domain.com ?

    – bc2946088
    May 12 '16 at 18:45













  • No. Each 'hostname' is one word. And all the communication is made with IP addresses and no hostname or domain name

    – Fab Ien Millerand
    May 13 '16 at 6:53



















  • So, you have a client and server, that are connected locally? While you're connected to the internet everything works, however when the internet is disconnected, you can't connect to the server? Your client is getting a public IP address for the server and not the local, so when the public is down it can't route? I'm not sure I completely follow.

    – bc2946088
    May 12 '16 at 13:11











  • So, both client and server are on the same local network. client has IP 192.168.1.121 and server has IP 192.168.1.124 What is troubling is that when I connect to the server (by SSH for example), the server is trying to resolve the 'hostname' 192.168.1.121.... It doesn't make much sense to me.... So when I unplugged the internet cab;e from the router, it takes 8 or 10 seconds to NOT resolve it, thus 'blocking' the connection process for as many seconds. For SSH it is fine, but the websockets I am using time out on connection

    – Fab Ien Millerand
    May 12 '16 at 13:46











  • Is your 'hostname' including the domain name, with a tld? Like hostname.domain.com ?

    – bc2946088
    May 12 '16 at 18:45













  • No. Each 'hostname' is one word. And all the communication is made with IP addresses and no hostname or domain name

    – Fab Ien Millerand
    May 13 '16 at 6:53

















So, you have a client and server, that are connected locally? While you're connected to the internet everything works, however when the internet is disconnected, you can't connect to the server? Your client is getting a public IP address for the server and not the local, so when the public is down it can't route? I'm not sure I completely follow.

– bc2946088
May 12 '16 at 13:11





So, you have a client and server, that are connected locally? While you're connected to the internet everything works, however when the internet is disconnected, you can't connect to the server? Your client is getting a public IP address for the server and not the local, so when the public is down it can't route? I'm not sure I completely follow.

– bc2946088
May 12 '16 at 13:11













So, both client and server are on the same local network. client has IP 192.168.1.121 and server has IP 192.168.1.124 What is troubling is that when I connect to the server (by SSH for example), the server is trying to resolve the 'hostname' 192.168.1.121.... It doesn't make much sense to me.... So when I unplugged the internet cab;e from the router, it takes 8 or 10 seconds to NOT resolve it, thus 'blocking' the connection process for as many seconds. For SSH it is fine, but the websockets I am using time out on connection

– Fab Ien Millerand
May 12 '16 at 13:46





So, both client and server are on the same local network. client has IP 192.168.1.121 and server has IP 192.168.1.124 What is troubling is that when I connect to the server (by SSH for example), the server is trying to resolve the 'hostname' 192.168.1.121.... It doesn't make much sense to me.... So when I unplugged the internet cab;e from the router, it takes 8 or 10 seconds to NOT resolve it, thus 'blocking' the connection process for as many seconds. For SSH it is fine, but the websockets I am using time out on connection

– Fab Ien Millerand
May 12 '16 at 13:46













Is your 'hostname' including the domain name, with a tld? Like hostname.domain.com ?

– bc2946088
May 12 '16 at 18:45







Is your 'hostname' including the domain name, with a tld? Like hostname.domain.com ?

– bc2946088
May 12 '16 at 18:45















No. Each 'hostname' is one word. And all the communication is made with IP addresses and no hostname or domain name

– Fab Ien Millerand
May 13 '16 at 6:53





No. Each 'hostname' is one word. And all the communication is made with IP addresses and no hostname or domain name

– Fab Ien Millerand
May 13 '16 at 6:53










2 Answers
2






active

oldest

votes


















0














you can add static hostname aliases for IP addresses to your /etc/hosts
file to have them resolve without using DNS.



Gotchas:



Be carefull to ensure the 127.0.0.1 locahost line remains intact as it can cause lots of other problems if thats missing.



The hosts file is still used when you are connected so its up to you to ensure that it makes sense in that situation as you can alias any hostname to any ip with it.






share|improve this answer
























  • I know, but I can't rewrite the host with all the IP addresses of the local network. I would just like the local IPs not to be 'resolved' as if they were domain names....

    – Fab Ien Millerand
    May 12 '16 at 13:47











  • i don't see why you can't add all the hosts to the /etc/hosts file , if you can refer to them in code they are static enough to go in that file. Maybe some more detail might help.

    – Amias
    May 13 '16 at 11:01











  • because: - I don't think it is a nice way of doing it - I also work on big networks with 'subnetworks' where the Local Server subnetwork can be different from the 'client' subnetwork... Thus prevent to make that solution happen...

    – Fab Ien Millerand
    May 13 '16 at 12:27





















0














Me and all my colleagues had same problem, I fix this issue by install samba and restart services after that.



sudo apt install samba


then



sudo service smbd restart


after this you can connect to other network place by Entering something like this:



smb://domain.something/somepath$






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    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%2faskubuntu.com%2fquestions%2f771303%2fubuntu-is-trying-to-resolve-local-ip-addresses%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    you can add static hostname aliases for IP addresses to your /etc/hosts
    file to have them resolve without using DNS.



    Gotchas:



    Be carefull to ensure the 127.0.0.1 locahost line remains intact as it can cause lots of other problems if thats missing.



    The hosts file is still used when you are connected so its up to you to ensure that it makes sense in that situation as you can alias any hostname to any ip with it.






    share|improve this answer
























    • I know, but I can't rewrite the host with all the IP addresses of the local network. I would just like the local IPs not to be 'resolved' as if they were domain names....

      – Fab Ien Millerand
      May 12 '16 at 13:47











    • i don't see why you can't add all the hosts to the /etc/hosts file , if you can refer to them in code they are static enough to go in that file. Maybe some more detail might help.

      – Amias
      May 13 '16 at 11:01











    • because: - I don't think it is a nice way of doing it - I also work on big networks with 'subnetworks' where the Local Server subnetwork can be different from the 'client' subnetwork... Thus prevent to make that solution happen...

      – Fab Ien Millerand
      May 13 '16 at 12:27


















    0














    you can add static hostname aliases for IP addresses to your /etc/hosts
    file to have them resolve without using DNS.



    Gotchas:



    Be carefull to ensure the 127.0.0.1 locahost line remains intact as it can cause lots of other problems if thats missing.



    The hosts file is still used when you are connected so its up to you to ensure that it makes sense in that situation as you can alias any hostname to any ip with it.






    share|improve this answer
























    • I know, but I can't rewrite the host with all the IP addresses of the local network. I would just like the local IPs not to be 'resolved' as if they were domain names....

      – Fab Ien Millerand
      May 12 '16 at 13:47











    • i don't see why you can't add all the hosts to the /etc/hosts file , if you can refer to them in code they are static enough to go in that file. Maybe some more detail might help.

      – Amias
      May 13 '16 at 11:01











    • because: - I don't think it is a nice way of doing it - I also work on big networks with 'subnetworks' where the Local Server subnetwork can be different from the 'client' subnetwork... Thus prevent to make that solution happen...

      – Fab Ien Millerand
      May 13 '16 at 12:27
















    0












    0








    0







    you can add static hostname aliases for IP addresses to your /etc/hosts
    file to have them resolve without using DNS.



    Gotchas:



    Be carefull to ensure the 127.0.0.1 locahost line remains intact as it can cause lots of other problems if thats missing.



    The hosts file is still used when you are connected so its up to you to ensure that it makes sense in that situation as you can alias any hostname to any ip with it.






    share|improve this answer













    you can add static hostname aliases for IP addresses to your /etc/hosts
    file to have them resolve without using DNS.



    Gotchas:



    Be carefull to ensure the 127.0.0.1 locahost line remains intact as it can cause lots of other problems if thats missing.



    The hosts file is still used when you are connected so its up to you to ensure that it makes sense in that situation as you can alias any hostname to any ip with it.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered May 12 '16 at 12:37









    AmiasAmias

    4,2401329




    4,2401329













    • I know, but I can't rewrite the host with all the IP addresses of the local network. I would just like the local IPs not to be 'resolved' as if they were domain names....

      – Fab Ien Millerand
      May 12 '16 at 13:47











    • i don't see why you can't add all the hosts to the /etc/hosts file , if you can refer to them in code they are static enough to go in that file. Maybe some more detail might help.

      – Amias
      May 13 '16 at 11:01











    • because: - I don't think it is a nice way of doing it - I also work on big networks with 'subnetworks' where the Local Server subnetwork can be different from the 'client' subnetwork... Thus prevent to make that solution happen...

      – Fab Ien Millerand
      May 13 '16 at 12:27





















    • I know, but I can't rewrite the host with all the IP addresses of the local network. I would just like the local IPs not to be 'resolved' as if they were domain names....

      – Fab Ien Millerand
      May 12 '16 at 13:47











    • i don't see why you can't add all the hosts to the /etc/hosts file , if you can refer to them in code they are static enough to go in that file. Maybe some more detail might help.

      – Amias
      May 13 '16 at 11:01











    • because: - I don't think it is a nice way of doing it - I also work on big networks with 'subnetworks' where the Local Server subnetwork can be different from the 'client' subnetwork... Thus prevent to make that solution happen...

      – Fab Ien Millerand
      May 13 '16 at 12:27



















    I know, but I can't rewrite the host with all the IP addresses of the local network. I would just like the local IPs not to be 'resolved' as if they were domain names....

    – Fab Ien Millerand
    May 12 '16 at 13:47





    I know, but I can't rewrite the host with all the IP addresses of the local network. I would just like the local IPs not to be 'resolved' as if they were domain names....

    – Fab Ien Millerand
    May 12 '16 at 13:47













    i don't see why you can't add all the hosts to the /etc/hosts file , if you can refer to them in code they are static enough to go in that file. Maybe some more detail might help.

    – Amias
    May 13 '16 at 11:01





    i don't see why you can't add all the hosts to the /etc/hosts file , if you can refer to them in code they are static enough to go in that file. Maybe some more detail might help.

    – Amias
    May 13 '16 at 11:01













    because: - I don't think it is a nice way of doing it - I also work on big networks with 'subnetworks' where the Local Server subnetwork can be different from the 'client' subnetwork... Thus prevent to make that solution happen...

    – Fab Ien Millerand
    May 13 '16 at 12:27







    because: - I don't think it is a nice way of doing it - I also work on big networks with 'subnetworks' where the Local Server subnetwork can be different from the 'client' subnetwork... Thus prevent to make that solution happen...

    – Fab Ien Millerand
    May 13 '16 at 12:27















    0














    Me and all my colleagues had same problem, I fix this issue by install samba and restart services after that.



    sudo apt install samba


    then



    sudo service smbd restart


    after this you can connect to other network place by Entering something like this:



    smb://domain.something/somepath$






    share|improve this answer






























      0














      Me and all my colleagues had same problem, I fix this issue by install samba and restart services after that.



      sudo apt install samba


      then



      sudo service smbd restart


      after this you can connect to other network place by Entering something like this:



      smb://domain.something/somepath$






      share|improve this answer




























        0












        0








        0







        Me and all my colleagues had same problem, I fix this issue by install samba and restart services after that.



        sudo apt install samba


        then



        sudo service smbd restart


        after this you can connect to other network place by Entering something like this:



        smb://domain.something/somepath$






        share|improve this answer















        Me and all my colleagues had same problem, I fix this issue by install samba and restart services after that.



        sudo apt install samba


        then



        sudo service smbd restart


        after this you can connect to other network place by Entering something like this:



        smb://domain.something/somepath$







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited yesterday

























        answered yesterday









        RamGRamG

        12




        12






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • 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%2faskubuntu.com%2fquestions%2f771303%2fubuntu-is-trying-to-resolve-local-ip-addresses%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

            How did Captain America manage to do this?

            迪纳利

            南乌拉尔铁路局