Forward domain name to localhost


I have a reverse proxy to follow my local server with a domain name.

But when I use in local the domain name I have a RFC error.

So, how can I route all request with * to directly my reverse proxy local adress ?

Example : -> to 10.x.x.x server

And, I haved modified my DNS with openDNS but I don't have my local DNS up too.

How can I use first my local DNS (to join my local server) and use openDNS in the same time ?

I need to join my local server with a name and request internet domain name with openDNS ?

Thanks you

You can create a hostname from an IP.

Then whichever lan host queries OpenWrt for that hostname, will get the private IP as an answer.

Ok I have create hostname but the problem that I need to use openDNS with hostname because I have as DNS and I can't use hostname with it.

Set the OpenWrt system level resolver/dns forwarding to OpenDNS, and configure your local devices to use the OpenWrt router as their DNS server. This way all requests will first go to the OpenWrt router. From there, the router will first perform a lookup to see if the domain is in the local table (in this case, it will be since you'll have defined it as such). If the domain is there, it will return the result. If it isn't, it will forward the request to your specified upstream DNS resolver (OpenDNS in your case) for resolution.

1 Like

I think it's the best solution, but where can I set openDNS to openwrt ?

There are two ways to do it... either set the DNS servers on the WAN to the OpenDNS ones (and disable the "peer dns"/"use DNS servers advertised by peer" setting on the interface), or set the DNS forwarding in the DHCP and DNS settings. From a practical perspective in your use case, both of these methods will have the same effect.


Ok perfect it work.

Do you have a solution for my second problem ?

I need to join my local server with a domain name in my local server (actually RFC block it).

Because I have some server with agent that need to communicate with the domain name and not the local IP.

So, how can I route all my query * to localIP directly ?

did you read the page that @trendy linked?

I tried :

uci add_list dhcp.@dnsmasq[0].address="/home/"
uci commit dhcp
/etc/init.d/dnsmasq restart

with my domain name and my server and always RFC even a reboot.

This is not A and AAAA RR ?

What does this mean?

I have add this line in my dhcp config :

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/'
        option localservice '1'
        option ednspacket_max '1232'
        list address '/gribiere/'

That means when I use domain-name I have always RFC error

I need that my domain name "gribiere" need to join my local IP

Sorry for my bad english

What is giving you the RFC error? What is the specific error?

should this be something like or or just as you have it?

Well done, all works perfectly

Thanks you both for help.

The RFC error it's a blanked page with error when you try to use domain name -> ip local adress when you are always in the local network

Openwrt use it

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.