2

i have the following entries in my nginx.conf, this allows me to go to http://somerandomstuff.domain.ie, which my app_subdomain_handler application then handles, this works ok.

upstream app_subdomain_handler {
        server 127.0.0.1:5001;
        keepalive 8;
}

server {
    listen 0.0.0.0:80;
    server_name *.domain.ie;
    location / {
    proxy_pass http://app_subdomain_handler/;
    proxy_redirect off;
    proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_set_header X-NginX-Proxy true;
    }
}

server {
    listen 443 ssl;
    server_name *.domain.ie;
    location / {
    proxy_pass http://app_subdomain_handler/;
    proxy_redirect off;
    proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_set_header X-NginX-Proxy true;
    }
}

my problem is that if i add a dns TXT record, say for test.domain.ie, the app_subdomain_handler never recieves the request. I've checked via tcpdump, using

tcpdump port 80 -s 0 -w capture.cap

and nginx never sees the request. test.domain.ie returns a Server not found message in the browser.

i use linode for hosting and nameservers, there are multiple TXT records, any ideas? Why does the TXT record cause the subdomain not to resolve?

6
  • What's the domain? What does dig test.domain.ie output?
    – ceejayoz
    Nov 13, 2015 at 17:52
  • https://xbt.ie/ id 58177 opcode QUERY rcode NOERROR flags QR RD RA ;QUESTION test.xbt.ie. IN TXT ;ANSWER test.xbt.ie. 21599 IN TXT "oa1:btc recipient_address=test; recipient_name=; tx_description=; " ;AUTHORITY ;ADDITIONAL Nov 13, 2015 at 19:05
  • 1
    I don't see any A records for test.xbt.ie, which seems like it'd be the cause of your problem. You can have both A and TXT coexisting for the same domain/subdomain.
    – ceejayoz
    Nov 13, 2015 at 20:20
  • is it correct to say that an A record must exist where a TXT record exists in order for the subdomain to resolve? Nov 14, 2015 at 10:26
  • An A record is necessary for a domain to resolve to an IP address. TXT records have nothing to do with that. Some situations require a TXT (like SPF records). Some situations require an A (like wanting people to get to a website). You can have A, TXT, or both. They have different purposes.
    – ceejayoz
    Nov 14, 2015 at 16:38

2 Answers 2

1

Because that's how wildcard DNS records work. A wildcard will only be used if there are no records of any type for the name, not just if there are no records of the requested type. This is to ensure that requests for ANY records don't behave differently to type-specific requests.

1

You should use A records (or CNAMEs eventually). TXT records should not help.

The idea would be to have this in your zone file:

@ IN A ipaddressofyourwebserver
www IN A ipaddressofyourwebserver
* IN A ipaddressofyourwebserver

What is your real domain name, so that we can help?

1
  • xbt.ie the site explains more, but the TXT records as used as part of some other functionality. Nov 13, 2015 at 19:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .