rbndr icon indicating copy to clipboard operation
rbndr copied to clipboard

How do I set up my own service?

Open gprime31 opened this issue 2 years ago • 2 comments

Hi, this is a great service, thanks so much. but how can I set up my own?

gprime31 avatar Mar 03 '22 14:03 gprime31

The domain name rbndr.us is hard-coded in rebinder.c. In order to set up your own working version, you need two things:

  1. An NS record for a domain or subdomain you own.
  2. A modified rebinder.c which is set up to handle your domain.

Let's say I own juggle.nu, and I want to use it for a rebinder service. I host this on the machine ns0.juggle.nu. In the DNS setup of juggle.nu, I set up an NS record, indicating that ns0.juggle.nu is the domain name server of this domain.

On the machine ns0, I run rbndr which I have modified as follows:

...

struct __packed root {                                 
   struct __packed {
       uint8_t len;        // 6                               
       uint8_t data[6];    // 'j' 'u' 'g' 'g' 'l' 'e'
   } domain;                                                                                                                 
   struct __packed {     
       uint8_t len;        // 2                                                                                              
       uint8_t data[2];    // 'n' 'u'                    
   } tld;                                     
   uint8_t root;           // 0                                                                                              
};                                                            
                                                              
static const struct root kExpectedDomain = {                  
   .domain = { 6, { 'j', 'u', 'g', 'g', 'l', 'e' } },     
   .tld    = { 2, { 'n', 'u' } },                                                                                       
   .root   = 0,                                                                                                              
};   

Take careful note, that the len fields and the sizes of the data fields have been altered to fit the length of each text string. juggle is six characters, therefore domain.len=6 and domain.data[] is of size 6.

With these modifications, I'll be able to query the rebinder and see the results:

On ns0.juggle.nu

$ gcc rebinder.c -o rebinder
$ sudo ./rebinder

Test it from the same machine:

$ dig @localhost 7f000001.c0a80001.juggle.nu
$ dig @localhost 7f000001.c0a80001.juggle.nu
$ dig @localhost 7f000001.c0a80001.juggle.nu
$ dig @localhost 7f000001.c0a80001.juggle.nu
$ dig @localhost 7f000001.c0a80001.juggle.nu

Some of the requests will come back as 127.0.0.1 and some as 192.168.0.1

You can also do this with a subdomain rather than the whole of juggle.nu, but it requires more modification to the root struct.

eldstal avatar Aug 30 '22 07:08 eldstal

The domain name rbndr.us is hard-coded in rebinder.c. In order to set up your own working version, you need two things:

  1. An NS record for a domain or subdomain you own.
  2. A modified rebinder.c which is set up to handle your domain.

Let's say I own juggle.nu, and I want to use it for a rebinder service. I host this on the machine ns0.juggle.nu. In the DNS setup of juggle.nu, I set up an NS record, indicating that ns0.juggle.nu is the domain name server of this domain.

On the machine ns0, I run rbndr which I have modified as follows:

...

struct __packed root {                                 
   struct __packed {
       uint8_t len;        // 6                               
       uint8_t data[6];    // 'j' 'u' 'g' 'g' 'l' 'e'
   } domain;                                                                                                                 
   struct __packed {     
       uint8_t len;        // 2                                                                                              
       uint8_t data[2];    // 'n' 'u'                    
   } tld;                                     
   uint8_t root;           // 0                                                                                              
};                                                            
                                                              
static const struct root kExpectedDomain = {                  
   .domain = { 6, { 'j', 'u', 'g', 'g', 'l', 'e' } },     
   .tld    = { 2, { 'n', 'u' } },                                                                                       
   .root   = 0,                                                                                                              
};   

Take careful note, that the len fields and the sizes of the data fields have been altered to fit the length of each text string. juggle is six characters, therefore domain.len=6 and domain.data[] is of size 6.

With these modifications, I'll be able to query the rebinder and see the results:

On ns0.juggle.nu

$ gcc rebinder.c -o rebinder
$ sudo ./rebinder

Test it from the same machine:

$ dig @localhost 7f000001.c0a80001.juggle.nu
$ dig @localhost 7f000001.c0a80001.juggle.nu
$ dig @localhost 7f000001.c0a80001.juggle.nu
$ dig @localhost 7f000001.c0a80001.juggle.nu
$ dig @localhost 7f000001.c0a80001.juggle.nu

Some of the requests will come back as 127.0.0.1 and some as 192.168.0.1

You can also do this with a subdomain rather than the whole of juggle.nu, but it requires more modification to the root struct.

And how you can do it with a subdomain?

NikOverflow avatar Apr 27 '23 07:04 NikOverflow