cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add a local DNS entry to TG582n

millerc
Dabbler
Posts: 11
Registered: ‎01-09-2013

How can I add a local DNS entry to TG582n

Hi everyone,
I have a small server at home and I have a domain name.  My server is a small mail server that I use for testing and dealing with my families email accounts.  I've added a host entry into my domains DNS record and that resolves fine but I would like computers on the LAN to resolve the host entry across to the server on the LAN instead of going outside the LAN to resolve the host.
I've been trying to add a dns host entry to the Technicolor TG582n router via the CLI through telnet.
I tried the following cli command but it fails and I'm not sure why:
dns server host add name=email.mydomainname.me.uk addr=192.168.1.20 ttl=30
But it fails stating:
Failed to add DNS host. [Name clash or invalid host name]
Does anyone know how to configure an internal LAN host entry so that my computers on the LAN can resolve the host to an ip on the LAN instead of resolving the external ip of the public DNS host entry?
Thanks,
Chris
9 REPLIES 9
npr
Pro
Posts: 1,898
Thanks: 119
Fixes: 9
Registered: ‎21-01-2013

Re: How can I add a local DNS entry to TG582n

Your LAN computers will not be going outside the LAN, the router has a "loopback adaptor" which should keep the connection within your network.
If you still wish to use a dns host entry, try using  ".lan" in place of ".me.uk" .
Quote
dns server host add name=email.mydomainname.lan addr=192.168.1.20 ttl=30
saveall
millerc
Dabbler
Posts: 11
Registered: ‎01-09-2013

Re: How can I add a local DNS entry to TG582n

Thanks npr,
I would like to use the same host entry because some of the devices on my LAN are mobile and my host name externally resolves to the IP address of my internet connection.  However, when those devices are back on the LAN then they should use the routers DNS and resolve to a local IP on the LAN instead.
When the computers on the lan query email.mydomainname.me.uk then they all resolve to the external IP which is incorrect and I don't really want to have to use .lan instead just for when the devices are back on the LAN.
I'll keep trying other things to get this to work.  I may have to end up replacing the router with something more capable.
Thanks again,
Chris
AndyH
Grafter
Posts: 6,824
Thanks: 1
Registered: ‎27-10-2012

Re: How can I add a local DNS entry to TG582n

Is there a /etc/hosts file on that router?
npr
Pro
Posts: 1,898
Thanks: 119
Fixes: 9
Registered: ‎21-01-2013

Re: How can I add a local DNS entry to TG582n

Quote from: millerc

When the computers on the lan query email.mydomainname.me.uk then they all resolve to the external IP which is incorrect and I don't really want to have to use .lan instead just for when the devices are back on the LAN.

I only see that as a problem when/if the router has dropped the internet.
Why do you see it as incorrect?
AndyH
Grafter
Posts: 6,824
Thanks: 1
Registered: ‎27-10-2012

Re: How can I add a local DNS entry to TG582n

Incorrect in the sense that he wants to point the sub domain email.mydomainname.me.uk to the internal IP rather than the external IP when he is connected to his LAN.
I think the only way of doing this is to be able to edit a hosts file on the router (if there is one that can be edited).
npr
Pro
Posts: 1,898
Thanks: 119
Fixes: 9
Registered: ‎21-01-2013

Re: How can I add a local DNS entry to TG582n

Quote from: AndyH
Incorrect in the sense that he wants to point the sub domain email.mydomainname.me.uk to the internal IP rather than the external IP when he is connected to his LAN.

But that's what the routers loopback adapter does. It will point the WAN IP back to the LAN IP.
If the Name and the servers LAN IP address are entered in the computers hosts file then that computer will not connect to the domain when on a different LAN.
This is no use if the device is used on other networks / internet connection (eg mobile phones).
AndyH
Grafter
Posts: 6,824
Thanks: 1
Registered: ‎27-10-2012

Re: How can I add a local DNS entry to TG582n

Quote from: npr
But that's what the routers loopback adapter does. It will point the WAN IP back to the LAN IP.

Got it thanks - so essentially the OP doesn't need to do anything?
npr
Pro
Posts: 1,898
Thanks: 119
Fixes: 9
Registered: ‎21-01-2013

Re: How can I add a local DNS entry to TG582n

I don't see the need. Wink
If you try to connect to your own WAN IP address, you only get as far as the routers WAN interface.
NATP then routes the connection back to the LAN IP address which is mapped to the connection port, that's assuming there's a port forward rule in place or UPnP is doing PF.
millerc
Dabbler
Posts: 11
Registered: ‎01-09-2013

Re: How can I add a local DNS entry to TG582n

Hi guys,
Thanks for all the help but this just doesn't seem to work.
When a machine on the LAN tries to access that host entry they just simply get the routers login page and nothing more.  Changing host files on the mobile devices also won't work seemlessly.
It just seems that this device just won't do this for some reason.  I can't spend any more time trying to get this to work so I think I'll just have to replace the router with a more capable one.
Thanks again guys.
Cheers,
Chris