different dns and gateway for different websites

Dear users,
I can specify two set of DNS and gateway in our network. The issue is some website wont work with both.
for example

if xxx.xx.xx.xxx
yyy.yy.yy.yyy
is a set of DNS with
gateway ggg.gg.gg.gg

and works for most of the websites

some site works with another set of DNS and gateway similar to the one above

is it possible to specify the different dns and gate way for different websites.
regards
nuncio

I suggest you leave the track you’re on now, and contact the sysadmins to do something about the network configs.

That’s the job of sys-admins.
You should read something about DNS and Resource Records before doing anything with that.
That’s the way, how it works!

Your network administrators (and may be you) should try to understand a bit about different concepts in networking, the words that are used for them and their relatations (or better, the lack of them).

You are talking about three different things:

  • Gateway. This is a system in a LAN that is also connected to another network then that LAN. It’s goal is to transfer packages from (and to) that LAN to (and from) the outside world. There can be more of them in a LAN, each connecting to different sets of IP addresses outside that LAN. Routing statements in the other systems on that LAN define which gateway to use for connecting to any IP address outside the LAN. Like handposts: for Market Place you go through that street). One of those gateways (the only one when there is but one gateway) is the default gateway. Meaning that when a route to an IP address is not to be routed through any other gateway, the default gateway is to be used.
  • DNS server. The sole purpose of a DNS server is to translate host-domainnames into IP addresses and v.v. It is a sort of telephone directory. Normaly an end-user uses a host-domainname e.g. in an URL (because it is easier to remind forums.opensuse.org then it’s IP address), which is then asap translated into an IP address. All other things in networking then use the IP address.
  • Web-sites. These are systems that run HTTP protocol server on a network. Those systems of course have an IP address and most probably are mentioned in a DNS server and thus also have a host-dommainname.

From this one can decide that having more then one gateway on a LAN is no problem, but connecting to a specific IP address one is routed through only one of the gateways. When you want e.g. to use another gateway to the same IP address you have to change the routing definition, which is not a trivial task (for an end-user), it includes knowing about IP ranges, network mask, etc. and of course being root. This is of course system wide.
And it can not be done on a user level let alone on a level that a specific user wants to connect to another IP address with the HTTP protocol (and in the mean time thinking that all his other traffic like mail wil not be touched by this).

As DNS is designed as being a world wide distributed database, your system points only to one DNS server (there most probably are more then one in your configuration, but the others are only there as fall back and should provide exact the same information). Again switching to another DNS server in a running system is possible, but not trivial (there can be cached data, etc.). And it is of course system wide.
It can not be done for a specific user. But the user can use the IP address wanted directly instead of using the host-domainname (which on your case would resolve to the “wrong” IP address).

In fact, like the others above, I do not realy understand what the situation is at your LAN. It seems to contradict laws of nature.

I do not think it is possible using client resolver library, but you can setup local DNS server which supports it. E.g. bind supports so called “forward zones” where you can forward requests for different domains to different servers. See example here: networking - Conditional DNS forwarding with named on Linux - Server Fault

Isn’t this suppose to work only if a DNS issue is involved? Yhe OP does mention the change of the IP/GW too I believe.

This looks to me more like a filtering / blocking situation, a DNSBL + IPFILTER maybe… for which the OP could use a non-blocking proxy though it would be better to stay off the banned sites, or indeed like somebody said a misconfiguration of the network, and the OP should contact the sysadmins. :slight_smile:

Cheers.

Right, I missed gateway issue. Well, different routing tables for different destinations is of course possible too, using policy based routing.

Read “DNS and BIND” or any tutorial in the internet. We have got DNS servers, who have got lists with Forward Lookup Zones and Reverse Lookup Zones. You are using Resource Records for translating FQDN to ip addresses and back there. The client asks the next DNS server, which he has got in his configuration, after the ip address of a special homepage. He is looking in his cache, whether he has got the information and give an answer. If he would not be able to answer, he asks the dns server of the parent domain, who has got a list with all zones of sub-domains and he will answer, where to ask next, or give the right ip address back.

You can have different DNS servers in a company and the configuration is a sysadmin-job. The same is with gateways.

Thanks for reminding me / us how the DNS works, it is a long time now since I configured the last one. :slight_smile:
I did not imply that my guess was the exact and only possible problem but actually I proposed another possible issue based on the OP and other posters’ information.

The forwarding that was already mentioned will actually work if configured so but also allowed to.

Some comment, some well-known

  1. Depends on whether you’re describing DNS Servers or DNS records. A client will generally connect to only one DNS Server. That DNS server can be configured to be authoritative or cache or forward requests for any combination of zones and/or records.

  2. Although a Client will use only one DNS server, a common method to “pollute” (re-direct connections) name records is to use Hosts files. They exist on all ethernet connected devices today, systems set up using other naming methods like NetBIOS only over ethernet are rare today.

  3. As described earlier, routing client connections through an alternate gateway is easily done by modifying the routing table.

  4. Although modifying Hosts files and routing tables on client machines might seem like a difficult task, this is actually not that difficult if you have control over your network’s DHCP, you can push these configurations to an entire or selected parts of the network very easily.

  5. An aside, when you’re talking about Web traffic in particular (http/s, ftp/s typically) you can deploy a Web Proxy. In this setup, all web browsers in a network can be configured to point to a different machine than the network’s default gateway for network connections. Depending on the capabilities of the Web Proxy itself, this special server can route and manage network connections which are different than other Internet protocols.

TSU