Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So I found out my problem when I would use the curl method on my linux Ubunutu 12.10 Server at home while logged in from my laptop (Mac OSX Lion). Nothing was happening when I would use the curl method so I thought I would try to ping a website where I know its up and running and I would get this:

ping: unknown host facebook.com

So Im guessing there is something blocking something here. I tried other sites with no success. Just the same error. I researched elsewhere but I couldn't really find a solution.

I typed this in terminal:

sudo iptables -L

...and I got this response

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Does that look fine to anybody or should there be more information in there?

Update

I should also add that I am pretty new to hosting my own server and I have a Dynamic IP at the moment and not a static one. I have learned a lot over the past short while but just want to give the heads up that I may not know a whole lot about it.

That being said everyone seems to think its a DNS issue. So I checked the etc/resolv.conf file and there wasn't anything in there except a commented message.

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

Did I forget a step when setting up my server? Also would this fix the curl issues I was having. I was just trying to install RVM by curl according to the tutorial but nothing happened. No message that it failed or succeeded.

Update 2

So I did some research and it looks like a known bug with Ubuntu 12.10 upgrade, which I had just did before using these commands.

DNS resolution fails after 12.10 upgrade

I thought the above was causing the problem but it wasn't in my case

Here is what reads inside /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.131
netmask 255.255.255.0
gateway 192.168.1.1

Thanks,

Joe

share|improve this question

migrated from serverfault.com Feb 6 '13 at 0:34

This question came from our site for professional system and network administrators.

    
That your /etc/resolv.conf file is empty suggests you're not getting the full DNS information from your router (or that you have somehow installed a dns server package on your Ubuntu machine that is taking precedence.) What does this command say? cat /etc/network/interfaces –  Stephan Feb 5 '13 at 22:55
    
@Stephan Just updated it. Have a look. Thanks –  JoeMoe1984 Feb 5 '13 at 23:06
    
That seems to be the issue. I've updated my answer. –  Stephan Feb 5 '13 at 23:12

3 Answers 3

up vote 1 down vote accepted

Agreed, this is a DNS resolution error. You can verify this by pinging facebooks actual IP:

# ping 173.252.110.27
# 64 bytes from 173.252.110.27: icmp_seq=0 ttl=239 time=124.665 ms
# 64 bytes from 173.252.110.27: icmp_seq=1 ttl=239 time=83.031 ms

If pinging the IP fails, it's likely a network issue. If it succeeds, it's likely a dns issue.

UPDATE

Based on new information:

I'll assume (and if I'm wrong, I'll need to know a lot more about your setup) that you have a typical broadband internet service provider, and a typical consumer grade router that your other machines connect to just fine. If that is the case, you should comment out the last 5 lines and add this at the end:

auto eth0
iface eth0 inet dhcp

Then perform these commands:

# sudo ifconfig eth0 down ; sudo ifconfig eth0 up ; sudo dhclient

Let me know if anything errors out.

share|improve this answer
    
Thanks, It seems like it is a DNS issue. Do you know how to fix the DNS issue or at least lead me in the right track. If you need more info I can provide it to you by testing and updating my question. –  JoeMoe1984 Feb 5 '13 at 22:47
    
I will have to get back to you on that when I get home. These commands I will have to do on my server. Also whats with all the down votes? Should I reword some things? Also does would this affect curl as well? I can rewrite my question if it does. –  JoeMoe1984 Feb 5 '13 at 23:36
    
Thanks, this worked. Both using ping and curl are working normally. I had a feeling it was something stupid like that. –  JoeMoe1984 Feb 6 '13 at 17:26

You need a dns-nameservers option in the iface eth0 inet static stanza of /etc/network/interfaces. The argument of this option should be the IP address of some nameserver. After adding this option, do ifdown eth0 ; ifup eth0.

Also make sure that the resolvconf package is installed and that /etc/resolv.conf is a symbolic link to ../run/resolvconf/resolv.conf; if it isn't, run sudo dpkg-reconfigure resolvconf.

share|improve this answer

This is a name resolution error, not a ping error, per se. Check that your DNS is configured properly (/etc/resolv.conf)

share|improve this answer
1  
to add steps: try pinging 4.2.2.2 or 8.8.8.8. If they resolve, definitely a DNS name resolution issue. –  TheCleaner Feb 5 '13 at 21:03
    
@TheCleaner yes that works. I also updated my question too. –  JoeMoe1984 Feb 5 '13 at 22:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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