I moved my server to my work and setup everything.
Changed the Internal IP to a new on and also changed the static IP to a new one.
When I do a ifconfig the new IP address/default-gateway/subnet all show as correctly.
The problem is I can't access the server through any pc on the network, can't ping any domain or external IP, can't do a apt-get anything, I added new rules to the firewall I am using now(mikrotike router/firwall) allowed port 80 and also pointed the new static IP to my domain company used(onlydomains.com). I also restarted apache2, the actual server and even router.
I can only ping internal IP's only.

I checked out many posts and google and was told to check:

/etc/gai.conf (uncomment. precedence::ffff:0:0/96 100) to get apt-get working
also flush ip setting

When the server was by my home everything worked perfectly. I could access the website, ssh into the server from anywhere and so on.

I am so confused and don't know what needs to be done in order to fix it.

*If this has been solved somewhere please direct me there. Thanks


ip route output:

default via dev eno1 onlink dev eno1 proto kernel scope link src

changes made in /etc/network/interfaces = I changed the network/broadcast/gateway as these were outside the range of the IP Address.

Can reach the server via SSH and can ping the default gateway however I can't ping any domain only IP's on the network. Also can't do any apt-get's.

dig google.com

; <<>> Dig 9.10.3-P4-Ubuntu <<>> google.com
;; global options: +cmd
;; connection timed out; no servers could be reached


nameserver 41.xxx.0.36
nameserver 41.xxx.0.37
search website.com

dig google.com @

;<<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17942
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 512
;google.com IN A

google.com. 192 IN A

;; QUERY time: 104 msec
;; WHEN: Fri Apr 13 10:22:42 SAST 2018
;; MSG SIZE rcvd: 55

default via dev eno1 onlink dev eno1 proto kernel scope link src

So your local network is by the looks of it, and your IP address on eno1 is

But your default gateway is

This will not work. Your local gateway is outside your local network, so you have no means of contacting it.

You have to check your network settings in /etc/network/interfaces, so that the configuration is consistent. When that's done verify that you're able to ping your default gateway.

In addition, it seems that your defined DNS servers do not work. Some suggested servers would be Cloudflare's, at or Google's at

In /etc/network/interfaces you will have a line like

dns-nameservers 41...

Change this to dns-nameservers for instance, and either reboot, or edit /etc/resolv.conf and replace the current nameserver 41... lines with nameserver

Verify that you're able to ping google.com

  • I can now ping the default gateway and can reach the server via SSH, however I cannot do any apt-get's – Deez Nutz Apr 12 '18 at 12:33
  • You probably have to set DNS server as well. – vidarlo Apr 12 '18 at 12:57
  • How would I do that? I am still a noob when it comes to this. I have set the dns-nameserver in the /etc/network/interfaces. And set it in the /etc/resolv.conf – Deez Nutz Apr 12 '18 at 14:00
  • I have tried a solution from another post where it was said to try ifdown eno1 && sudo ifup eno1 but that made no difference. Does it take time for things to sink in before that command would work maybe? – Deez Nutz Apr 12 '18 at 14:08
  • What is the content of /etc/resolv.conf? What happens if you try dig google.com @ What happens if you try dig google.com? Edit your question with the outputs, and ping me in a message :) – vidarlo Apr 12 '18 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.