Can't access localhost server through DNS

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
martixy
DD-WRT Novice


Joined: 29 Oct 2012
Posts: 16

PostPosted: Sun Jul 23, 2017 18:51    Post subject: Can't access localhost server through DNS Reply with quote
I have a problem it seems, I've got a web server running on my machine and I am the only one who can't access it via its web address.

Other machines on the same network or the internet in general can access it, but from the machine on which it is hosted, the request times out.

I have port 80/443 forwarded on the router.

Here is my router:
Router Model Netgear R7000
Firmware Version DD-WRT v24-sp2 (10/08/14) kongac - build 25100M

Apart from mapping the address in my hosts, what can I do to fix this? What could be causing it?
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6870
Location: Romerike, Norway

PostPosted: Sun Jul 23, 2017 19:33    Post subject: Reply with quote
This is not a router issue.

On the web server make an entry in the hosts file with the domain name as 127.0.0.1 as address.

Loopback for the external address is not enabled on the server.
martixy
DD-WRT Novice


Joined: 29 Oct 2012
Posts: 16

PostPosted: Mon Jul 24, 2017 0:28    Post subject: Reply with quote
Per Yngve Berg wrote:
On the web server make an entry in the hosts file with the domain name as 127.0.0.1 as address.


Are you talking about something else than what I mentioned in my last sentence in the OP?

It may not seem like a router issue, but the router is the only thing that's changed recently, and it was working before, therefore I am led to that conclusion.
It may be wrong, but I don't even know how to debug the issue, so pointers there will also be welcome.
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6870
Location: Romerike, Norway

PostPosted: Mon Jul 24, 2017 6:33    Post subject: Reply with quote
Didn't use of a hosts file resolve it?

Are all local clients using the router as dns server?

You can add a dnsmasq option on the router so the domain name is resolving to the local address for local machines instead of the public wan address.

Quote:
A, --address=/<domain>[/<domain>...]/[<ipaddr>]
Specify an IP address to return for any host in the given domains. Queries in the domains are never forwarded and always replied to with the specified IP address which may be IPv4 or IPv6. To give both IPv4 and IPv6 addresses for a domain, use repeated -A flags. To include multiple IP addresses for a single query, use --addn-hosts=<path> instead. Note that /etc/hosts and DHCP leases override this for individual names. A common use of this is to redirect the entire doubleclick.net domain to some friendly local web server to avoid banner ads. The domain specification works in the same was as for --server, with the additional facility that /#/ matches any domain. Thus --address=/#/1.2.3.4 will always return 1.2.3.4 for any query not answered from /etc/hosts or DHCP and not sent to an upstream nameserver by a more specific --server directive. As for --server, one or more domains with no address returns a no-such-domain answer, so --address=/example.com/ is equivalent to --server=/example.com/ and returns NXDOMAIN for example.com and all its subdomains.


Here is the dnsmasq manual: http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

On dd-wrt you fill in the Services->Additional DNSMasq Options Field.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum