creating virtual hosts does not work properly on Ubuntu 16.04

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








up vote
1
down vote

favorite












i have created a virtual host on my virtual machine.

The Host does not resolves properly.

These are the steps i have done:



  1. /etc/hosts added 127.0.0.1 example.com


  2. created example.com.conf in sites-available and loaded sexample.com.conf via a2ensite and reloaded apache.

My conf file:



<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName example.com
</VirtualHost>


But example.com redirects me to the reals Domain with IP 93.184.216.34.

My /etc/nsswitch.conf file looks like this:



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


My /etc/resolve.conf loks like this:



nameserver 127.0.1.1
search *****.com









share|improve this question



























    up vote
    1
    down vote

    favorite












    i have created a virtual host on my virtual machine.

    The Host does not resolves properly.

    These are the steps i have done:



    1. /etc/hosts added 127.0.0.1 example.com


    2. created example.com.conf in sites-available and loaded sexample.com.conf via a2ensite and reloaded apache.

    My conf file:



    <VirtualHost *:80>
    DocumentRoot /var/www/html
    ServerName example.com
    </VirtualHost>


    But example.com redirects me to the reals Domain with IP 93.184.216.34.

    My /etc/nsswitch.conf file looks like this:



    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


    My /etc/resolve.conf loks like this:



    nameserver 127.0.1.1
    search *****.com









    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      i have created a virtual host on my virtual machine.

      The Host does not resolves properly.

      These are the steps i have done:



      1. /etc/hosts added 127.0.0.1 example.com


      2. created example.com.conf in sites-available and loaded sexample.com.conf via a2ensite and reloaded apache.

      My conf file:



      <VirtualHost *:80>
      DocumentRoot /var/www/html
      ServerName example.com
      </VirtualHost>


      But example.com redirects me to the reals Domain with IP 93.184.216.34.

      My /etc/nsswitch.conf file looks like this:



      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


      My /etc/resolve.conf loks like this:



      nameserver 127.0.1.1
      search *****.com









      share|improve this question















      i have created a virtual host on my virtual machine.

      The Host does not resolves properly.

      These are the steps i have done:



      1. /etc/hosts added 127.0.0.1 example.com


      2. created example.com.conf in sites-available and loaded sexample.com.conf via a2ensite and reloaded apache.

      My conf file:



      <VirtualHost *:80>
      DocumentRoot /var/www/html
      ServerName example.com
      </VirtualHost>


      But example.com redirects me to the reals Domain with IP 93.184.216.34.

      My /etc/nsswitch.conf file looks like this:



      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


      My /etc/resolve.conf loks like this:



      nameserver 127.0.1.1
      search *****.com






      networking server virtualbox apache2 dns






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 28 at 15:00

























      asked Feb 28 at 13:23









      bunower

      62




      62




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          the problem caused because i have to work nehind a proxy.
          If you work behind a proxy /etc/hosts does not work.
          You have to ignore the hosts in etc/hosts.



          The simplest and fastest way to do this is setting up no_proxy in /etc/environment.

          To do this edit /etc/environment and add or append no_proxy like : no_proxy= "localhost, 127.0.0.1, example.com" in my case i had to set proxy settings on Firefox aswell.

          And restart your machine.

          If you want to check your proxy settings you can run following command env | grep proxy.






          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',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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%2faskubuntu.com%2fquestions%2f1010656%2fcreating-virtual-hosts-does-not-work-properly-on-ubuntu-16-04%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            the problem caused because i have to work nehind a proxy.
            If you work behind a proxy /etc/hosts does not work.
            You have to ignore the hosts in etc/hosts.



            The simplest and fastest way to do this is setting up no_proxy in /etc/environment.

            To do this edit /etc/environment and add or append no_proxy like : no_proxy= "localhost, 127.0.0.1, example.com" in my case i had to set proxy settings on Firefox aswell.

            And restart your machine.

            If you want to check your proxy settings you can run following command env | grep proxy.






            share|improve this answer
























              up vote
              0
              down vote













              the problem caused because i have to work nehind a proxy.
              If you work behind a proxy /etc/hosts does not work.
              You have to ignore the hosts in etc/hosts.



              The simplest and fastest way to do this is setting up no_proxy in /etc/environment.

              To do this edit /etc/environment and add or append no_proxy like : no_proxy= "localhost, 127.0.0.1, example.com" in my case i had to set proxy settings on Firefox aswell.

              And restart your machine.

              If you want to check your proxy settings you can run following command env | grep proxy.






              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                the problem caused because i have to work nehind a proxy.
                If you work behind a proxy /etc/hosts does not work.
                You have to ignore the hosts in etc/hosts.



                The simplest and fastest way to do this is setting up no_proxy in /etc/environment.

                To do this edit /etc/environment and add or append no_proxy like : no_proxy= "localhost, 127.0.0.1, example.com" in my case i had to set proxy settings on Firefox aswell.

                And restart your machine.

                If you want to check your proxy settings you can run following command env | grep proxy.






                share|improve this answer












                the problem caused because i have to work nehind a proxy.
                If you work behind a proxy /etc/hosts does not work.
                You have to ignore the hosts in etc/hosts.



                The simplest and fastest way to do this is setting up no_proxy in /etc/environment.

                To do this edit /etc/environment and add or append no_proxy like : no_proxy= "localhost, 127.0.0.1, example.com" in my case i had to set proxy settings on Firefox aswell.

                And restart your machine.

                If you want to check your proxy settings you can run following command env | grep proxy.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 1 at 14:07









                bunower

                62




                62



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1010656%2fcreating-virtual-hosts-does-not-work-properly-on-ubuntu-16-04%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Trouble downloading packages list due to a “Hash sum mismatch” error

                    How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                    How do I move numbers in filenames, in a batch renaming operation?