LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-15-2012, 06:27 AM   #1
x4954
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Rep: Reputation: Disabled
dig @my-server-ip mydomain.com works from inside, not from outside?


Hi,

My server has 2 ips: x.x.x.73 and x.x.x.248. I can access my site via these ips, using Web browser.



{Now, from a centos machine (not my server), using terminal}
If I:

dig @x.x.x.73 mydomain.com
dig @x.x.x.248 mydomain.com


I get the result:
Connection timed out; no server could be reached.

Could somebody please tell me how to fix it? Thank you.

*****

More information:

If I log in to my server using ssh and do:
dig @x.x.x.73 mydomain.com
dig @x.x.x.248 mydomain.com

I can see my zone shown as expected:

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5_7.1 <<>> @x.x.x.73 mydomain.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12757
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;mydomain.com. IN A

;; ANSWER SECTION:
mydomain.com. 38400 IN A x.x.x.73
mydomain.com. 38400 IN A x.x.x.248

;; AUTHORITY SECTION:
mydomain.com. 38400 IN NS ns2.mydomain.com.
mydomain.com. 38400 IN NS ns1.mydomain.com.

;; ADDITIONAL SECTION:
ns1.mydomain.com. 38400 IN A x.x.x.73
ns2.mydomain.com. 38400 IN A x.x.x.248

;; Query time: 20 msec
;; SERVER: x.x.x.73#53(x.x.x.73)
;; WHEN: Sun Jan 15 11:46:30 2012
;; MSG SIZE rcvd: 129

*****

-BIND version 9.3.6, Centos 5.
- ping.eu/port-chk shows that my server ip x.x.x.73:53 port is open.
-Logging to my server using ssh, do a "dig google.com" also shows expected results.
 
Old 01-15-2012, 07:58 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
dig @x.x.x.73 mydomain.com
dig @x.x.x.248 mydomain.com

I get the result:
Connection timed out; no server could be reached.
Could be a firewall blocking port 53udp/tcp
Quote:
- ping.eu/port-chk shows that my server ip x.x.x.73:53 port is open.
Since the above shows port 53 open, but dig cannot reach your dns, you should make sure that port 53 is open for both udp and tcp protocols.
If fact it's udp that is primarily used for dns queries.

Regards
 
Old 01-16-2012, 02:36 AM   #3
x4954
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you for your help...

Code:
[root@monday ~]# netstat -tulpn

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 x.x.x.248:53                0.0.0.0:*                   LISTEN      15649/named
tcp        0      0 x.x.x.73:53                 0.0.0.0:*                   LISTEN      15649/named
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN      15649/named
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1559/sshd
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN      15649/named
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1596/sendmail: acce
tcp        0      0 0.0.0.0:10000               0.0.0.0:*                   LISTEN      1645/perl
tcp        0      0 :::53                       :::*                        LISTEN      15649/named
tcp        0      0 :::22                       :::*                        LISTEN      1559/sshd
tcp        0      0 ::1:953                     :::*                        LISTEN      15649/named
tcp        0      0 :::443                      :::*                        LISTEN      1619/httpd
tcp        0      0 :::80                       :::*                        LISTEN      1619/httpd
udp        0      0 x.x.x.248:53                0.0.0.0:*        15649/named
udp        0      0 x.x.x.73:53                 0.0.0.0:*        15649/named
udp        0      0 127.0.0.1:53                0.0.0.0:*        15649/named
udp        0      0 0.0.0.0:10000               0.0.0.0:*        1645/perl
udp        0      0 :::53                       :::*             15649/named
Could you please tell me if port udp 53 is already opened for bind? ...because the upd port state is not shown? (I do not know much on iptable).

Last edited by x4954; 01-16-2012 at 02:38 AM.
 
Old 01-16-2012, 03:30 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Use:
Code:
iptables -L INPUT -n |grep 53
to see if port 53 is open for both tcp/udp

Regards
 
Old 01-16-2012, 04:00 AM   #5
x4954
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi,

netstat -tulpn above shows that port 53udp/tcp is already opened. Is that right?

[root@monday ~]# iptables -L RH-Firewall-1-INPUT -n |grep 53
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53

...but I still cannot
dig @x.x.x.73 mydomain.com
dig @x.x.x.248 mydomain.com
from outside my vps server.

Could you please suggest more?...
Thanks.
 
Old 01-16-2012, 04:15 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
netstat -tulpn above shows that port 53udp/tcp is already opened. Is that right?
The netstat output shows that bind is listening on the default port (53 tcp/udp). If the port is blocked by a firewall you will get no connection to it.
Anyway try to use tcp and see if you get your answer:
Code:
dig @x.x.x.73 mydomain.com +tcp
 
Old 01-16-2012, 04:38 AM   #7
x4954
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi,

Yes, dig @x.x.x.73 mydomain.com +tcp works as expected. But dig @x.x.x.73 mydomain.com doesn't.

[root@monday ~]# iptables -L RH-Firewall-1-INPUT -n |grep 53
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53
Does this mean my server firewall does not block port 53 tcp/udp?

Regards.
Thank you for replying so quickly.


------------------
I have this vps server 5 months ago. During that period, I have installed apache, php, bind, postfix etc... and reinstalled them again and again many times; and they work fine all the time- even without my knowledge on iptable and firewall related stuffs. But this time, after doing a re-installation, bind does not work...
Nightmare, 2 days searching and trying many things on google, still can't find out what's wrong with the bind yet...
 
Old 01-16-2012, 04:58 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
So port 53 tcp is open.

Quote:
[root@monday ~]# iptables -L RH-Firewall-1-INPUT -n |grep 53
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53
Does this mean my server firewall does not block port 53 tcp/udp?
Yes, apparently it does not blocking port 53 tcp/udp, but since you get no response when using the default udp protocol, it means the port is closed somehow.
I don't know how RH-Firewall operates, but you might take a look here to see what you need to do.

Regards
 
Old 01-16-2012, 05:29 PM   #9
x4954
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi,

It is my hosting/vps provider blocked it. It's fine now.
Thank you so much for kindly pointing out the issue.

Best regards.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix-Squirrelmail: Mail sent to user1@mydomain.com delivered to user2@mydomain.com tsouvalasi Linux - Server 4 02-26-2010 08:15 AM
Web site mydomain.com is found but www.mydomain.com is not, why? RileyTheWiley Linux - Networking 5 09-15-2009 04:36 PM
Mediawiki on mydomain.com without typing mydomain/wiki crispyleif Linux - Server 4 04-11-2009 10:22 AM
dig @ works, dig doesn't eelgueta Linux - Networking 6 07-09-2007 06:45 PM
Apache: 'mydomain.com' doesn't work ('www.mydomain.com' does) guarriman Linux - Software 2 12-07-2006 04:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration