Score:0

Can I host site on one server with domain connected to bind ns on another?

mr flag

I've got domain testshop.homes. It's connected to bind NS. Bind is on server with IP 81.171.5.222 and domain looks up on this IP. Can I host this domain (apache, files, DB) on another server with IP 15.235.51.16? I already created apache config, files and DB on 15.235.51.16 but site has error DNS_PROBE_FINISHED_NXDOMAIN.

On namecheap I just add nameservers in configuration (these nameservers are working and fully configurated) enter image description here

ru flag
You can run the DB on another server, but you cannot run Apache independent from the site files. There's no way to safely do that, because the HTTP requests for web browsers has to land on Apache. YOu can configure your site to use external DBs though if you configure stuff properly.
Regular User avatar
mr flag
@ThomasWard thank you for your reply. I want files, DB and apache run on one server, not to run apache on one server and have files on another but run bind on another (site will have IP of server that runs bind) can I do that?
ru flag
no, you cannot have Apache on one server and files on another. That isn't how Apache or Webservers work. BIND aside, your Apache web server and the files its serving **MUST** be on the same system.
Regular User avatar
mr flag
@ThomasWard You didn't get wthat I meant. I have bind config for domain (records) on one server and Apache, DB, files on another. Bind records connect domain to this IP `81.171.5.222` and Apache, DB, files are on `15.235.51.16`. Can apache host domain if domain connected to another IP, different from IP of server with apache? Or I should change bind records to connect domain to `15.235.51.16`?
ru flag
I think your setup is unclear. NXDOMAIN requires your *domain server* to be pointed to properly at the registrar level. Your BIND9 server can be anywhere provided you set the domain properly. In your case, though, you're working with a nonexistent domain. `testshop.homes` exists SOLELY on your internal network. If your computer is not configured to query that BIND server *first* then you will not ever see the domain exist. This is better explained with *live* websites though, because that is a **real world example** of how things're set up.
ru flag
Important question though, do you own `testshop.homes`? Because that's an actual domain registered at NameCheap and likely misconfigured at NameCheap.
Regular User avatar
mr flag
@ThomasWard I own this domain. I can send you screen with configuration
Regular User avatar
mr flag
@ThomasWard I add screenshot of my configuration
ru flag
ns1.true-nameserver.com and ns2.true-nameserver.com does not work on the Internet and returns SERVFAIL for all DNS nameservers on the Internet. `true-nameserver.com` does NOT exist and `NXDOMAIN` fails, which in turn leads to DNS failing, which in turn is why your site is entirely busted from the OUtside and why you get NXDOMAIN for your domain. This is a wider problem than 'where your DNS nameserver lives'.
Regular User avatar
mr flag
I bought `true-nameserver.com` and created 2 nameservers - ns1.true-nameserver.com and ns2.true-nameserver.com. I configured them properly and whois shows that `testshop.homes` is connected to these NS https://who.is/whois/testshop.homes . Also if I make records in bind that give that domain IP `81.171.5.222` you can check it with nslookup
ru flag
you have to create **glue records** at the registrar for ns1 and ns2 to then function properly. And I did check with nslookup - the issue isn't your nameserver the issue is how the Internet works. If `ns1` and `ns2` for a nameserver are within the same domain you need to create glue records at the registrar. Which you haven't done so the records don't exist from the public Internet and SERVFAIL.
Regular User avatar
mr flag
@ThomasWard Hi there. I've just fixed records but now `testshop.homes` is being host at 81.171.5.222 server (server with bind) not at 15.235.51.16 (server with apache). What's wrong? I didn't configure apache, it just has default apache's configuration
ru flag
with the limited scope of visibility here into your domains, I can't give you an answer - there's a hundred possibilities for what's going on (domain misconfiguration, bind misconfiguration, etc.) that I can't scope out here with just Ask Ubuntu, and go beyond the scope of Ubuntu because it involves registrar checking, etc. You might need to hire an administrator to assist you because I think you hoave numerous things wrong here.
Score:0
ru flag

It's a little unclear what you've got, but let's do some splitting up based on what I see in your question:

(1) You have a BIND9 DNS nameserver running for the site testshop.homes. This nameserver sits at 81.171.5.222.

(2) You have an Apache webserver for your site at 15.235.51.16.

This is totally acceptable. Your BIND9 nameserver and your Apache web server do not need to exist at the same IP address. This is common-place because people run their websites and such on one server but use third-parties like CloudFlare or their domain registrars to run the DNS. However, if you change where your BIND9 server exists, you have to change a lot more to make the domain still resolve - this usually requires changes at the registrar / hosting provider depending on what you use to get it so nameservers are properly reached where the DNS records for your domain actually exist.


Real world example: my own domain - thomas-ward.net. (no this is not an advert).

If we look at the nameservers on the domain's configuration, they point at CloudFlare's DNS servers. That means that the nameservers are run by Cloudflare, and that I've configured this at my registrar so that DNS records properly reach CloudFlare for my domain's requests.

The actual webserver for my domain sits at 50.211.[NOPE].[SILENCE]. That's an individual A record in the DNS zone. This is NOT a cloudflare server and is the IP address at the location of my server cluster. These are completely different servers. However, this only works when the DNS servers for your domain are reachable and they are properly configured at your registrar.

Case in point: I have a local-only domain that exists ONLY on my laptop internally - static-local.lxd (for my LXD containers that aren't ephemeral). This runs on the DNS nameserver of 10.10.1.0 which only exists on my laptop. In order to query static-local.lxd, I have to have my computer's DNS set so that the first server it queries is that local container on my laptop here - that in turn handles all my DNS. If I change the IP address on the nameserver or change my DNS settings to NOT query 10.10.1.0 first, then I never see static-local.lxd and my DNS system falls back to Google DNS - which in turn shows NXDOMAIN because that domain name doesn't exist in the real world of the Internet.

Note that I've done some digging in the Internet and your domain you've stated is already owned by someone, and does NOT have any DNS nameserver entries that correspond to either of the IP addresses you've stated - so the NXDOMAIN issues you're seeing are related to your DNS no longer resolving to the proper nameserver, AND because that domain owned by someone at Namecheap is wholly misconfigured to a dead nameserver and will never resolve properly if this is your actual site - you need to reconfigure it from scratch with proper web server / DNS practices to even begin to make things work right

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.