Redirect one domain to another domain?

Discussion in 'Tomato Firmware' started by Quad5Ny, May 5, 2014.

  1. Quad5Ny

    Quad5Ny Networkin' Nut Member

    I'm looking to have routed to for a single computer on my LAN (

    So far the only thing I've come up with is using iptables: iptables -t nat -A PREROUTING -s -d -j DNAT --to-destination

    Is there anything a bit more elegant that would allow me to do this using Domain names instead of IP's? Because if a IP changes then my rule is useless.
  2. koitsu

    koitsu Network Guru Member

    dnsmasq can "sort of" do this; it can make resolve to an IP address of your choice, and you can limit what client (i.e. source address) is affected by IP address, IP address range, or MAC using "tags" (in dnsmasq terminology) -- as long as your machine is using DHCP in some way (dynamic or static, doesn't matter). However, if's IP address changes, you're SOL. Anyway, the capability is achieved through the alias directive in dnsmasq Custom Config. There are other threads that talk about this in depth.

    The "proper" way to do this -- and to my knowledge dnsmasq cannot do this (if someone more educated than me knows otherwise, please correct me and explain how) -- would be to make dnsmasq return, for, a DNS CNAME record that points to In that situation no IP addresses are involved; a client would try to resolve, get shown a CNAME for (by dnsmasq), would then try to resolve and get back an IP address (as it would normally).

    Also be aware that a DNS lookup for is not the same thing as a DNS lookup for or If you really need that kind of wildcard support, you need to look into running your own DNS server (i.e. BIND). I myself do this to blackhole/blacklist certain domains, such as, to keep ads from appearing in Skype.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice